WinXAddControl


hControl = WinXAddControl (parent, STRING class, STRING title, style, exStyle, id)

Creates a new child window control. This function can be used to create custom controls not otherwise supported by WinX.

Parameter Description
parent The window to add the control to
STRING class The window class to create the control from
STRING title The text to initialise the control to. Just use the empty string if this parameter is irrelavent
style The windows style for the control. Note that the WinXAddControl function will add the WS_CHILD, WS_VISIBLE and WS_TABSTOP styles.
exStyle The extended windows style. For most controls this will be 0.
id The unique ID constant to identify this control.

Returns

The handle to the control on success, 0 on fail

Remarks

If you need to process messages from a custom control, use the WinXRegMessageHandler to register a callback function to receive those messages.

Examples

'create a button manually
$$ID_BUTTON = 100
hButton = WinXAddControl (#hMain, "BUTTON", "Click Me!", $$BS_PUSHBUTTON, 0, $$ID_BUTTON)

Related Links

WinXRegMessageHandler