MiniGUI API Reference (MiniGUI-Standalone)
v5.0.6
A mature and proven cross-platform GUI system for embedded and smart IoT devices
|
Functions | |
MG_EXPORT HWND GUIAPI | CreateWindowEx2 (const char *spClassName, const char *spCaption, DWORD dwStyle, DWORD dwExStyle, LINT id, int x, int y, int w, int h, HWND hParentWnd, const char *werdr_name, const WINDOW_ELEMENT_ATTR *we_attrs, DWORD dwAddData) |
Creates a child window with extended style, renderer and attributes table. More... | |
static HWND GUIAPI | CreateWindowEx (const char *spClassName, const char *spCaption, DWORD dwStyle, DWORD dwExStyle, LINT id, int x, int y, int w, int h, HWND hParentWnd, DWORD dwAddData) |
A shortcut version of CreateWindowEx2. More... | |
MG_EXPORT BOOL GUIAPI | DestroyWindow (HWND hWnd) |
Destroys a specified control. More... | |
MG_EXPORT NOTIFPROC GUIAPI | SetNotificationCallback (HWND hwnd, NOTIFPROC notif_proc) |
Set a new notification callback procedure for a window. More... | |
MG_EXPORT NOTIFPROC GUIAPI | GetNotificationCallback (HWND hwnd) |
Get the notification callback procedure of a control. More... | |
|
inlinestatic |
A shortcut version of CreateWindowEx2.
This function creates a child window by calling CreateWindowEx2 function and passing NULL for both werdr_name and we_attrs parameters.
HWND GUIAPI CreateWindowEx2 | ( | const char * | spClassName, |
const char * | spCaption, | ||
DWORD | dwStyle, | ||
DWORD | dwExStyle, | ||
LINT | id, | ||
int | x, | ||
int | y, | ||
int | w, | ||
int | h, | ||
HWND | hParentWnd, | ||
const char * | werdr_name, | ||
const WINDOW_ELEMENT_ATTR * | we_attrs, | ||
DWORD | dwAddData | ||
) |
Creates a child window with extended style, renderer and attributes table.
This function creates a child window (also known as "control") with extended style, renderer and attributes table. It specifies the window class, the window title, the window style, the window extended style, the initial position, and the size of the window, etc. The function also specifies the window's parent or owner.
spClassName | The class name of the control. |
spCaption | The caption of the control. |
dwStyle | The control style. |
dwExStyle | The extended control style. |
id | The identifier of the control. |
x | x,y: The initial position of the control in the parent window. |
y | x,y: The initial position of the control in the parent window. |
w | The initial width of the control. |
h | The initial height of the control. |
hParentWnd | The handle to the parent window. |
werdr_name | The window renderer name. NULL for default renderer. |
we_attrs | The pointer to window element attribute table. NULL for default attribute table. |
dwAddData | The first private additional data of the control. Note that some control classes use this value to initialize some properties of the new control instance. For these control classes, you should pass a valid value to it. |
Destroys a specified control.
This function destroys the specified control hWnd, which is created by CreateWindowEx or CreateWindowEx2.
hWnd | The handle to the control. |
Get the notification callback procedure of a control.
This function gets the new notification callback procedure of the control of hwnd.
hwnd | The handle to the control. |
Set a new notification callback procedure for a window.
This function sets the new notification callback procedure (notif_proc) for the specified window hwnd.
In the early versions, the notification message will be sent to the target window as a MSG_COMMAND message.
Since version 1.2.6, MiniGUI defines the Notification Callback Procedure for a window. You can specify a callback function for a window by calling SetNotificationCallback to receive and handle the notifications from its children in the procedure.
Since version 5.0.0, the notification callback procedure also works for a main window or a virtual window.
If you did not set the notification callback function of the target window, you must handle MSG_COMMAND message in the window procedure of the target window. However, due to historical reasons, MSG_COMMAND has the following restrictions:
hwnd | The handle to the window. |
notif_proc | The new notification callback procedure, can be NULL. |