content top

Cursor Class

Cursor Class

  About Cursor Class   Cursor class is mainly used for loading and managing cursors.   Cursor Class Methods   Cursor.Add( string FileName ) Adds a .CUR file. If the function succeeds, the return value is the handle of the newly loaded resource. If the function fails, the return value is 0. string FileName: the name of the file.   Cursor.Delete( long CursorHandle ) Deletes a cursor and frees any memory the cursor occupied. If the function succeeds, the return value is true. If the function fails, the return value is false. long CursorHandle: cursor handle.   Cursor.SetPosition( long X, long Y ) sets the position of the mouse cursor, in screen coordinates. long X: x position in screen coordinates. long Y: y position in screen coordinates.   Cursor.GetX() retrieves the x position of the mouse cursor, in screen coordinates.   Cursor.GetY() retrieves the y position of the mouse cursor, in screen coordinates.   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 CursorHandle = 0; void Start() { Plugin.Initialize();//Initializes Giavapps Windows API CursorHandle = Giavapps.Windows.API.Cursor.Add("cursor.cur");//adds a new cursor 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 StaticHandle = Static.Create(WindowHandle, 10, 10, 150, 150, Constant.WS_VISIBLE | Constant.WS_CHILD | Constant.SS_ICON, 0);//creates a new static control Static.SetCursor(StaticHandle, CursorHandle);//Sets the previously added cursor to the specified static control } void Update() { //Checks if the specified window has been closed if(Window.GetClosed(WindowHandle)) { Control.Destroy(WindowHandle);//Destroys the specified window } } void OnApplicationQuit() { Giavapps.Windows.API.Cursor.Delete(CursorHandle);//deletes the previously added cursor 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

Bitmap Class

Bitmap Class

  About Bitmap Class   Bitmap class is mainly used for loading and managing bitmaps.   Bitmap Class Methods   Bitmap.Add( string FileName ) Adds a .BMP file. If the function succeeds, the return value is the handle of the newly loaded resource. If the function fails, the return value is 0. string FileName: the name of the file.   Bitmap.Delete( long BitmapHandle ) Deletes a bitmap and frees any memory the bitmap occupied. If the function succeeds, the return value is true. If the function fails, the return value is false. long BitmapHandle: bitmap 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 IconHandle = 0; private long BitmapHandle = 0; void Start() { Plugin.Initialize();//Initializes Giavapps Windows API IconHandle = Icon.Add("icon.ico");//adds a new icon BitmapHandle = Bitmap.Add("bitmap.bmp");//adds a new bitmap 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 Window.SetIcon(WindowHandle, IconHandle, Constant.ICON_SMALL);//Sets the previously added icon to the 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, "Click Me");//Sets a new text for the specified button Button.SetBitmap(ButtonHandle, BitmapHandle);//Sets the previously added bitmap to the button } void Update() { //Checks if the specified window has been closed if(Window.GetClosed(WindowHandle)) { Control.Destroy(WindowHandle);//Destroys the specified window } //Checks if the specified button has been clicked if(Button.GetClicked(ButtonHandle)) { Debug.Log("BUTTON CLICKED!"); } } void OnApplicationQuit() { Icon.Delete(IconHandle);//deletes the previously added icon Bitmap.Delete(BitmapHandle);//deletes the previously added bitmap 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

Button Class

Button Class

    About Button Class   Button class is mainly used for creating and managing buttons.   Button Class Methods   Button.Create( long ParentHandle, long X, long Y, long Width, long Height, long Style, long ExStyle ) creates a button. 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 button styles. long ExStyle: the extended style of the control being created. This parameter can be a combination of the extended window styles.   Button.Exists( long ButtonHandle ) returns true if the specified control was created with Button.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 ButtonHandle: button handle.   Button.Count() returns the total number of controls created with Button.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.   Button.GetHandleByIndex( ulong ButtonIndex ) returns the handle from an index if the specified control was created with Button.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. ButtonIndex parameter should be less or equal to Button.Count()-1. ulong ButtonIndex: zero-based index of the button.   Button.SetChecked( long ButtonHandle, long Checked ) sets the check state of a radio button or check box. long ButtonHandle: button handle. long Checked: check state. Checked argument can be one of the following constants. BST_CHECKED Sets the button state to checked. BST_INDETERMINATE Sets the button state to grayed, indicating an indeterminate state. Use this value only if the button has the BS_3STATE or BS_AUTO3STATE style. BST_UNCHECKED Sets the button state to cleared.   Button.GetChecked( long ButtonHandle ) Gets the check state of a radio button or check box. long ButtonHandle: button handle. The return value from a button created with the BS_AUTOCHECKBOX,...

Read More

Icon Class

Icon Class

  About Icon Class   Icon class is mainly used for loading and managing icons.   Icon Class Methods   Icon.Add( string FileName ) Adds an .ICO file. If the function succeeds, the return value is the handle of the newly loaded resource. If the function fails, the return value is 0. string FileName: the name of the file.   Icon.Delete( long IconHandle ) Deletes an icon and frees any memory the icon occupied. If the function succeeds, the return value is true. If the function fails, the return value is false. long IconHandle: icon 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 IconHandle = 0; void Start() { Plugin.Initialize();//Initializes Giavapps Windows API IconHandle = Icon.Add("icon.ico");//adds a new icon 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 Window.SetIcon(WindowHandle, IconHandle, Constant.ICON_SMALL);//Sets the previously added icon to the window Control.SetText(WindowHandle, "Giavapps Windows API");//Sets a new title for the specified window } void Update() { //Checks if the specified window has been closed if(Window.GetClosed(WindowHandle)) { Control.Destroy(WindowHandle);//Destroys the specified window } } void OnApplicationQuit() { Icon.Delete(IconHandle);//deletes the previously added icon 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

Window Class

Window Class

    About Window Class   Window class is mainly used for creating and managing windows.   Window Class Methods   Window.Create( long ParentHandle, long X, long Y, long Width, long Height, long Style, long ExStyle ) creates an overlapped, pop-up, or child window. 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. long ExStyle: the extended style of the control being created. This parameter can be a combination of the extended window styles.   Window.Exists( long WindowHandle ) returns true if the specified control was created with Window.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 WindowHandle: window handle.   Window.Count() returns the total number of controls created with Window.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.   Window.GetHandleByIndex( ulong WindowIndex ) returns the handle from an index if the specified control was created with Window.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. WindowIndex parameter should be less or equal to Window.Count()-1. ulong WindowIndex: zero-based index of the window.   Window.SetActive( long WindowHandle ) activates a window. The window must be attached to the calling thread’s message queue. If the function succeeds, the return value is the handle to the window that was previously active. If the function fails, the return value is 0. long WindowHandle: window handle.   Window.GetActive() retrieves the window handle to the active window attached to the calling thread’s message queue. The return value is the handle to the active window attached to the calling thread’s message queue. Otherwise, the return value is 0.   Window.SetForeground( long WindowHandle ) brings the thread that created the specified window...

Read More

Control Class

Control Class

  About Control Class   Control class stores global controls functions so you can use these functions on different kind of controls (windows, buttons, combo boxes etc.).   Control Class Methods   Control.Destroy( long ControlHandle ) this function destroys the specified control. If the function succeeds, the return value is true. If the function fails, the return value is false. long ControlHandle: any control handle (WindowHandle, ButtonHandle, ComboBoxHandle, etc.).   Control.Show( long ControlHandle, long State ) sets the specified control’s show state. If the control was previously visible, the return value is true. If the control was previously hidden, the return value is false. long ControlHandle: any control handle (WindowHandle, ButtonHandle, ComboBoxHandle, etc.). long State: controls how the control is to be shown. State 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.   Control.SetMinimized( long ControlHandle ) minimizes the specified control and activates the next top-level control in the Z order. long ControlHandle: any control handle (WindowHandle, ButtonHandle, ComboBoxHandle, etc.).   Control.GetMinimized( long ControlHandle ) If the control is minimized, the return value is true. If the control is not minimized, the return value is false. long ControlHandle: any control handle (WindowHandle, ButtonHandle, ComboBoxHandle, etc.).   Control.SetMaximized( long ControlHandle ) maximizes the specified control. long ControlHandle: any control handle (WindowHandle, ButtonHandle, ComboBoxHandle, etc.).   Control.GetMaximized( long ControlHandle ) If...

Read More
content top