Control – Giavapps Windows API

api_control_set_focus(ControlHandle) This function sets the keyboard focus to the specified control. If the function succeeds, the return value is the handle to the window that previously had the keyboard focus.

ControlHandle: it can be any control handle (WindowHandle, ButtonHandle, ComboBoxHandle, etc.).

 

api_control_get_focus() This function retrieves the handle to the window that has the keyboard focus. The return value is the handle to the window with the keyboard focus.

 

api_control_get_owner(ControlHandle) Returns the specified window’s owner window, if any. If the function fails the return value is false.

ControlHandle: it can be any control handle (WindowHandle, ButtonHandle, ComboBoxHandle, etc.).

 

api_control_set_parent(ControlHandle,ParentHandle) This function changes the parent handle of the specified control. If the function succeeds, the return value is a handle to the previous parent handle. If the function fails, the return value is 0.

ControlHandle: it can be any control handle (WindowHandle, ButtonHandle, ComboBoxHandle, etc.).
ParentHandle: A handle to the new parent window. If this parameter is false, the desktop window becomes the new parent window.

 

api_control_get_parent(ControlHandle) This function retrieves a handle to the specified control’s parent or owner.

ControlHandle: it can be any control handle (WindowHandle, ButtonHandle, ComboBoxHandle, etc.).

 

api_control_set_style(ControlHandle,Flags) Sets a new control style.

ControlHandle: it can be any control handle (WindowHandle, ButtonHandle, ComboBoxHandle, etc.).
Flags: control style flags.

 

api_control_get_style(ControlHandle) Returns the style of the given control.

ControlHandle: it can be any control handle (WindowHandle, ButtonHandle, ComboBoxHandle, etc.).

 

api_control_set_exstyle(ControlHandle,ExFlags) Sets a new extended window style.

ControlHandle: it can be any control handle (WindowHandle, ButtonHandle, ComboBoxHandle, etc.).
ExFlags: extended window style flags.

 

api_control_get_exstyle(ControlHandle) Returns the extended window style of the given control.

ControlHandle: it can be any control handle (WindowHandle, ButtonHandle, ComboBoxHandle, etc.).

 

api_control_set_enabled(ControlHandle,Enabled) This function enables or disables a control.

ControlHandle: it can be any control handle (WindowHandle, ButtonHandle, ComboBoxHandle, etc.).
Enabled: enable (true) or disable (false).

 

api_control_get_enabled(ControlHandle) This function returns true if the control is enabled or false if it is disabled.

ControlHandle: it can be any control handle (WindowHandle, ButtonHandle, ComboBoxHandle, etc.).

 

api_control_set_position(ControlHandle,X,Y) This function changes the position of a control.

ControlHandle: it can be any control handle (WindowHandle, ButtonHandle, ComboBoxHandle, etc.).
X: the new x coordinate.
Y: the new y coordinate.

 

api_control_get_x(ControlHandle) Returns the x coordinate of a control.

ControlHandle: it can be any control handle (WindowHandle, ButtonHandle, ComboBoxHandle, etc.).

 

api_control_get_y(ControlHandle) Returns the y coordinate of a control.

ControlHandle: it can be any control handle (WindowHandle, ButtonHandle, ComboBoxHandle, etc.).

 

api_control_set_size(ControlHandle,W,H) This function changes the size of a control.

ControlHandle: it can be any control handle (WindowHandle, ButtonHandle, ComboBoxHandle, etc.).
W: the new width.
H: the new height.

 

api_control_get_width(ControlHandle) Returns the width of a control.

ControlHandle: it can be any control handle (WindowHandle, ButtonHandle, ComboBoxHandle, etc.).

 

api_control_get_height(ControlHandle) Returns the height of a control.

ControlHandle: it can be any control handle (WindowHandle, ButtonHandle, ComboBoxHandle, etc.).

 

api_control_set_zorder(ControlHandle,ControlHandleInsertAfter) This function changes the Z order of a control. Controls are ordered according to their appearance on the screen. The topmost control receives the highest rank and is the first control in the Z order.

ControlHandle: it can be any control handle (WindowHandle, ButtonHandle, ComboBoxHandle, etc.).
ControlHandleInsertAfter: a handle to the control to precede the positioned control in the Z order.

The ControlHandleInsertAfter parameter must be a control handle or one of the following values.

HWND_BOTTOM Places the window at the bottom of the Z order. If the ControlHandle parameter identifies a topmost control, the control loses its topmost status and is placed at the bottom of all other controls.

HWND_NOTOPMOST Places the control above all non-topmost controls (that is, behind all topmost controls). This flag has no effect if the control is already a non-topmost control.

HWND_TOP Places the control at the top of the Z order.

HWND_TOPMOST Places the control above all non-topmost controls. The control maintains its topmost position even when it is deactivated.

 

api_control_set_font(ControlHandle,FontHandle) Sets the font that a control is to use when drawing text.

ControlHandle: it can be any control handle (WindowHandle, ButtonHandle, ComboBoxHandle, etc.).
FontHandle: it can be a FontHandle.

 

api_control_set_text(ControlHandle,Text) This function sets the text of a control.

ControlHandle: it can be any control handle (WindowHandle, ButtonHandle, ComboBoxHandle, etc.).
Text: string with the text to set.

 

api_control_get_text(ControlHandle) This function gets the text of a control and returns a string that contains the text.

ControlHandle: it can be any control handle (WindowHandle, ButtonHandle, ComboBoxHandle, etc.).

 

api_control_redraw(ControlHandle) This function redraws the specified control. f the function succeeds, the return value is true or false otherwise.

ControlHandle: it can be any control handle (WindowHandle, ButtonHandle, ComboBoxHandle, etc.).

 

api_control_delete(ControlHandle) This functions destroys the specified control. If the function succeeds, the return value is true. If the function fails, the return value is false.

ControlHandle: it can be any control handle (WindowHandle, ButtonHandle, ComboBoxHandle, etc.).

 

api_control_get_last_error() This function returns the last error code value. This feature is useful for debugging.

 

Code Examples

 

Setting Position, Size and Z Order

 

window = api_window_create(0,0,0,0,0,WS_VISIBLE,0);
api_control_set_position(window,100,100);
api_control_set_size(window,300,300);
api_control_set_zorder(window,HWND_TOPMOST);

 

Setting And Getting Text

 

button = api_button_create(window,10,10,100,32,WS_VISIBLE|WS_CHILD|BS_PUSHBUTTON);
api_control_set_text(button,“Click Me!”);
gettext = api_control_get_text(button);
api_messagebox(window, gettext, “Text:”, MB_OK);

 

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 promotion.

Leave a Reply

Il tuo indirizzo email non sarà pubblicato. I campi obbligatori sono contrassegnati *

*