content top

Edit Class

Edit Class

    About Edit Class   Edit class is mainly used for creating and managing edit controls.   Edit Class Methods   Edit.Create( long ParentHandle, long X, long Y, long Width, long Height, long Style, long ExStyle ) creates a edit control. If the function succeeds, the return value is a handle to the new control. If the function fails, the return value is 0. long ParentHandle: a handle to the parent or owner control of the control being created. long X: x coordinate. You can also use CW_USEDEFAULT constant for this argument. long Y: y coordinate. You can also use CW_USEDEFAULT constant for this argument. long Width: width. You can also use CW_USEDEFAULT constant for this argument. long Height: height. You can also use CW_USEDEFAULT constant for this argument. long Style: the style of the control being created. This parameter can be a combination of the window styles and edit control styles. long ExStyle: the extended style of the control being created. This parameter can be a combination of the extended window styles.   Edit.Exists( long EditHandle ) returns true if the specified control was created with Edit.Create() method and not destroyed yet or false otherwise. Note that all child controls are destroyed when parent control is destroyed. You can also call Control.Destroy() method for destroying a specific control with all of its children. long EditHandle: edit control handle.   Edit.Count() returns the total number of controls created with Edit.Create() method and not destroyed yet. Note that all child controls are destroyed when parent control is destroyed. You can also call Control.Destroy() method for destroying a specific control with all of its children.   Edit.GetHandleByIndex( ulong EditIndex ) returns the handle from an index if the specified control was created with Edit.Create() method and not destroyed yet or 0 otherwise. Note that all child controls are destroyed when parent control is destroyed. You can also call Control.Destroy() method for destroying a specific control with all of its children. EditIndex parameter should be less or equal to Edit.Count()-1. ulong EditIndex: zero-based index of the edit control.   Edit.CanUndo( long EditHandle ) determines whether there are any actions in the undo queue of an edit control. This method returns true if there are actions in the undo queue; otherwise false. long EditHandle: edit control handle.   Edit.Undo( long EditHandle ) undoes the last operation in the undo queue of an edit or rich edit control. For a single-line control, the return value is always true. For a multiline control, the return value is true if the undo operation is successful, or false otherwise. long EditHandle: edit control handle.   Edit.ResetUndo( long EditHandle ) resets the...

Read More

ListBox Class

ListBox Class

    About ListBox Class   ListBox class is mainly used for creating and managing list boxes.   ListBox Class Methods   ListBox.Create( long ParentHandle, long X, long Y, long Width, long Height, long Style, long ExStyle ) creates a list box. If the function succeeds, the return value is a handle to the new control. If the function fails, the return value is 0. long ParentHandle: a handle to the parent or owner control of the control being created. long X: x coordinate. You can also use CW_USEDEFAULT constant for this argument. long Y: y coordinate. You can also use CW_USEDEFAULT constant for this argument. long Width: width. You can also use CW_USEDEFAULT constant for this argument. long Height: height. You can also use CW_USEDEFAULT constant for this argument. long Style: the style of the control being created. This parameter can be a combination of the window styles and list box styles. long ExStyle: the extended style of the control being created. This parameter can be a combination of the extended window styles.   ListBox.Exists( long ListBoxHandle ) returns true if the specified control was created with ListBox.Create() method and not destroyed yet or false otherwise. Note that all child controls are destroyed when parent control is destroyed. You can also call Control.Destroy() method for destroying a specific control with all of its children. long ListBoxHandle: list box handle.   ListBox.Count() returns the total number of controls created with ListBox.Create() method and not destroyed yet. Note that all child controls are destroyed when parent control is destroyed. You can also call Control.Destroy() method for destroying a specific control with all of its children.   ListBox.GetHandleByIndex( ulong ListBoxIndex ) returns the handle from an index if the specified control was created with ListBox.Create() method and not destroyed yet or 0 otherwise. Note that all child controls are destroyed when parent control is destroyed. You can also call Control.Destroy() method for destroying a specific control with all of its children. ListBoxIndex parameter should be less or equal to ListBox.Count()-1. ulong ListBoxIndex: zero-based index of the list box.   ListBox.AddItem( long ListBoxHandle, long ItemIndex, string ItemText ) adds a string or item data into a list box. The return value is the index of the position at which the string was inserted. If an error occurs, the return value is LB_ERR. If there is insufficient space to store the new string, the return value is LB_ERRSPACE. long ListBoxHandle: list box handle. long ItemIndex: zero-based index of the item or –1 to add it to the end of the list. string ItemText: item text.   ListBox.GetItem( long ListBoxHandle, long ItemIndex ) returns a string from a list...

Read More

Font Class

Font Class

  About Font Class   Font class is mainly used for loading and managing fonts.   Font Class Methods   Font.Add( string Name, long CharSet, long Size, long Weight, bool Italic, bool Underline, bool StrikeOut ) adds a logical font with the specified characteristics. string Name: string that specifies the typeface name of the font. long CharSet: the character set. long Size: size of the font. long Weight: weight of the font in the range 0 through 1000. If this value is zero, a default weight is used. bool Italic: specifies an italic font if set to true. bool Underline: specifies an underlined font if set to true. bool StrikeOut: specifies a strikeout font if set to true. CharSet parameter can be one of the following constants. ANSI_CHARSET ansi character set. DEFAULT_CHARSET specifies a character set that is based on the current system locale. For example, when the system locale is English (United States), it is set as ANSI_CHARSET. SYMBOL_CHARSET symbol character set. SHIFTJIS_CHARSET shiftjis character set. HANGEUL_CHARSET hangeul character set. HANGUL_CHARSET hangul character set. GB2312_CHARSET gb2312 character set. CHINESEBIG5_CHARSET chinesebig5 character set. OEM_CHARSET specifies a character set that is operating-system dependent. JOHAB_CHARSET johab character set. HEBREW_CHARSET hebrew character set. ARABIC_CHARSET arabic character set. GREEK_CHARSET greek character set. TURKISH_CHARSET turkish character set. VIETNAMESE_CHARSET vietnamese character set. THAI_CHARSET thai character set. EASTEUROPE_CHARSET east europe character set. RUSSIAN_CHARSET russian character set. MAC_CHARSET mac character set. BALTIC_CHARSET baltic character set. The Weight parameter can be one of the following constants. FW_DONTCARE 0 FW_THIN 100 FW_EXTRALIGHT 200 FW_ULTRALIGHT 200 FW_LIGHT 300 FW_NORMAL 400 FW_REGULAR 400 FW_MEDIUM 500 FW_SEMIBOLD 600 FW_DEMIBOLD 600 FW_BOLD 700 FW_EXTRABOLD 800 FW_ULTRABOLD 800 FW_HEAVY 900 FW_BLACK 900   Font.Delete( long FontHandle ) Deletes a font and frees any memory the font occupied. If the function succeeds, the return value is true. If the function fails, the return value is false. long FontHandle: font handle.   Code Example using System.Collections; using System.Collections.Generic; using UnityEngine; using Giavapps.Windows.API; public class CodeExample : MonoBehaviour { private long WindowHandle = 0; private long ButtonHandle = 0; private long FontHandle = 0; void Start() { Plugin.Initialize();//Initializes Giavapps Windows API FontHandle = Giavapps.Windows.API.Font.Add("Arial", Constant.ANSI_CHARSET, 20, 0, false, false, false);//Adds a new font WindowHandle = Window.Create(0, 100, 100, 400, 400, Constant.WS_VISIBLE | Constant.WS_SYSMENU | Constant.WS_MINIMIZEBOX | Constant.WS_MAXIMIZEBOX | Constant.WS_SIZEBOX, Constant.WS_EX_TOPMOST);//Creates a new window Control.SetText(WindowHandle, "Giavapps Windows API");//Sets a new title for the specified window ButtonHandle = Button.Create(WindowHandle, 10, 10, 150, 32, Constant.WS_VISIBLE | Constant.WS_CHILD, 0);//creates a new button Control.SetText(ButtonHandle, "Text");//Sets a new text for the specified button Control.SetFont(ButtonHandle, FontHandle);//Sets the previously added font to the specified button } void Update() { //Checks if the specified window has been closed if(Window.GetClosed(WindowHandle)) { Control.Destroy(WindowHandle);//Destroys...

Read More

Static Class

Static Class

    About Static Class   Static class is mainly used for creating and managing static controls.   Static Class Methods   Static.Create( long ParentHandle, long X, long Y, long Width, long Height, long Style, long ExStyle ) creates a static control. If the function succeeds, the return value is a handle to the new control. If the function fails, the return value is 0. long ParentHandle: a handle to the parent or owner control of the control being created. long X: x coordinate. You can also use CW_USEDEFAULT constant for this argument. long Y: y coordinate. You can also use CW_USEDEFAULT constant for this argument. long Width: width. You can also use CW_USEDEFAULT constant for this argument. long Height: height. You can also use CW_USEDEFAULT constant for this argument. long Style: the style of the control being created. This parameter can be a combination of the window styles and static control styles. long ExStyle: the extended style of the control being created. This parameter can be a combination of the extended window styles.   Static.Exists( long StaticHandle ) returns true if the specified control was created with Static.Create() method and not destroyed yet or false otherwise. Note that all child controls are destroyed when parent control is destroyed. You can also call Control.Destroy() method for destroying a specific control with all of its children. long StaticHandle: static control handle.   Static.Count() returns the total number of controls created with Static.Create() method and not destroyed yet. Note that all child controls are destroyed when parent control is destroyed. You can also call Control.Destroy() method for destroying a specific control with all of its children.   Static.GetHandleByIndex( ulong StaticIndex ) returns the handle from an index if the specified control was created with Static.Create() method and not destroyed yet or 0 otherwise. Note that all child controls are destroyed when parent control is destroyed. You can also call Control.Destroy() method for destroying a specific control with all of its children. StaticIndex parameter should be less or equal to Static.Count()-1. ulong StaticIndex: zero-based index of the static control.   Static.SetBitmap( long StaticHandle, long BitmapHandle ) associates a new bitmap with a static control. The return value is a handle to the image previously associated with the static control, if any; otherwise, it is 0. (This method only works on static controls with SS_BITMAP style) long StaticHandle: static control handle. long BitmapHandle: bitmap handle.   Static.GetBitmap( long StaticHandle ) returns a handle to the bitmap associated with a static control. (This method only works on static controls with SS_BITMAP style) long StaticHandle: static control handle.   Static.SetCursor( long StaticHandle, long CursorHandle ) associates a new cursor with...

Read More

ComboBox Class

ComboBox  Class

    About ComboBox Class   ComboBox class is mainly used for creating and managing combo boxes.   ComboBox Class Methods   ComboBox.Create( long ParentHandle, long X, long Y, long Width, long Height, long Style, long ExStyle ) creates a combo box. If the function succeeds, the return value is a handle to the new control. If the function fails, the return value is 0. long ParentHandle: a handle to the parent or owner control of the control being created. long X: x coordinate. You can also use CW_USEDEFAULT constant for this argument. long Y: y coordinate. You can also use CW_USEDEFAULT constant for this argument. long Width: width. You can also use CW_USEDEFAULT constant for this argument. long Height: height. You can also use CW_USEDEFAULT constant for this argument. long Style: the style of the control being created. This parameter can be a combination of the window styles and combo box styles. long ExStyle: the extended style of the control being created. This parameter can be a combination of the extended window styles.   ComboBox.Exists( long ComboBoxHandle ) returns true if the specified control was created with ComboBox.Create() method and not destroyed yet or false otherwise. Note that all child controls are destroyed when parent control is destroyed. You can also call Control.Destroy() method for destroying a specific control with all of its children. long ComboBoxHandle: combo box handle.   ComboBox.Count() returns the total number of controls created with ComboBox.Create() method and not destroyed yet. Note that all child controls are destroyed when parent control is destroyed. You can also call Control.Destroy() method for destroying a specific control with all of its children.   ComboBox.GetHandleByIndex( ulong ComboBoxIndex ) returns the handle from an index if the specified control was created with ComboBox.Create() method and not destroyed yet or 0 otherwise. Note that all child controls are destroyed when parent control is destroyed. You can also call Control.Destroy() method for destroying a specific control with all of its children. ComboBoxIndex parameter should be less or equal to ComboBox.Count()-1. ulong ComboBoxIndex: zero-based index of the combo box.   ComboBox.AddItem( long ComboBoxHandle, long ItemIndex, string ItemText ) adds a string to a list in a combo box at the specified location. The return value is the zero-based index of the string in the list. If an error occurs, the return value is CB_ERR. If there is insufficient space to store the new string, the return value is CB_ERRSPACE. long ComboBoxHandle: combo box handle. long ItemIndex: zero-based index of the item or –1 to add it to the end of the list. string ItemText: item text.   ComboBox.GetItem( long ComboBoxHandle, long ItemIndex ) returns a string from...

Read More
content top