content top

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

Color24 Class

Color24 Class

  About Color24 Class   Color24 class is mainly used for creating and managing 24-bit colors.   Color24 Class Methods   Color24.RGB( byte R, byte G, byte B ) returns a 24-bit color from RGB values. byte R: red component (0-255). byte G: green component (0-255). byte B: blue component (0-255).   Color24.R( long Color ) returns the red component from a 24-bit color. long Color: 24-bit color.   Color24.G( long Color ) returns the green component from a 24-bit color. long Color: 24-bit color.   Color24.B( long Color ) returns the blue component from a 24-bit color. long Color: 24-bit color.   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 ProgressBarHandle = 0; void Start() { Plugin.Initialize();//Initializes Giavapps Windows API 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 ProgressBarHandle = ProgressBar.Create(WindowHandle, 10, 10, 150, 32, Constant.WS_VISIBLE | Constant.WS_CHILD, 0);//Creates a new progress bar ProgressBar.SetPosition(ProgressBarHandle, 40);//Sets a new position for the specified progress bar ProgressBar.SetColorBar(ProgressBarHandle, Color24.RGB(255, 0, 0));//Sets a new color for the specified progress bar ProgressBar.SetColorBackground(ProgressBarHandle, Constant.CLR_DEFAULT);//Sets a new background color for the specified progress bar } void Update() { //Checks if the specified window has been closed if(Window.GetClosed(WindowHandle)) { Control.Destroy(WindowHandle);//Destroys the specified window } } void OnApplicationQuit() { Plugin.Deinitialize();//Deinitializes Giavapps Windows API } }   I am Luigi Piscopo, also known as DJ GiDeejay / Producer / Remixer in the music world. I am a Producer with a lot of experience in photo editing, video editing, audio editing, graphic design, web design, programming and...

Read More

Shell Class

Shell Class

  About Shell Class   Shell class is mainly used for executing shell commands.   Shell Class Methods   Shell.Command( string FileName, string Parameters, long Show ) performs an operation on a specified file. string FileName: specifies the file or object on which to execute the command. string Parameters: the parameters to be passed to the application. long Show: controls how an application is to be displayed when it is opened. Show can be one of the following constants. SW_FORCEMINIMIZE Minimizes a control, even if the thread that owns the control is not responding. This flag should only be used when minimizing controls from a different thread. SW_HIDE Hides the control or window and activates another control. SW_MAXIMIZE Maximizes the specified control. SW_MINIMIZE Minimizes the specified control and activates the next top-level control in the Z order. SW_RESTORE Activates and displays the control. If the control is minimized or maximized, the system restores it to its original size and position. An application should specify this flag when restoring a minimized control. SW_SHOW Activates the control and displays it in its current size and position. SW_SHOWDEFAULT Sets the show state based on the program that started the application. SW_SHOWMAXIMIZED Activates the control and displays it as a maximized control. SW_SHOWMINIMIZED Activates the control and displays it as a minimized control. SW_SHOWMINNOACTIVE Displays the control as a minimized control. This value is similar to SW_SHOWMINIMIZED, except the control is not activated. SW_SHOWNA Displays the control in its current state. The active control remains active. SW_SHOWNOACTIVATE Displays a control in its most recent size and position. The active control remains active. SW_SHOWNORMAL Activates and displays a control. If the control is minimized or maximized, the system restores it to its original size and position. An application should specify this flag when displaying the control for the first time.   Code Example using System.Collections; using System.Collections.Generic; using UnityEngine; using Giavapps.Windows.API; public class CodeExample : MonoBehaviour { private string FileName = "explorer.exe"; private string Parameters = "/select,\"C:\\Windows\\explorer.exe\""; private long Show = Constant.SW_SHOWNORMAL; void Start() { Plugin.Initialize();//Initializes Giavapps Windows API } void Update() { //Checks if the specified keyboard key has been pressed if(Input.GetKeyDown(KeyCode.Space)) { Shell.Command(FileName, Parameters, Show);//Executes a shell command } } void OnApplicationQuit() { Plugin.Deinitialize();//Deinitializes Giavapps Windows API } }   I am Luigi Piscopo, also known as DJ GiDeejay / Producer / Remixer in the music world. I am a Producer with a lot of experience in photo editing, video editing, audio editing, graphic design, web design, programming and...

Read More
content top