MiniGUI API Reference (MiniGUI-Threads)  v3.2.0
A mature and proven cross-platform GUI system for embedded and smart IoT devices
Macros | Typedefs | Functions
Control creating/destroying

Macros

#define CreateWindow(class_name, caption, style, id, x, y, w, h, parent, add_data)
 A simplified version of CreateWindowEx. More...
 

Typedefs

typedef void(* NOTIFPROC) (HWND hwnd, LINT id, int nc, DWORD add_data)
 Type of the notification callback procedure. More...
 

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)
 Sets a new notification callback procedure for a control. More...
 
MG_EXPORT NOTIFPROC GUIAPI GetNotificationCallback (HWND hwnd)
 Gets the notification callback procedure of a control. More...
 

Detailed Description

Macro Definition Documentation

#define CreateWindow (   class_name,
  caption,
  style,
  id,
  x,
  y,
  w,
  h,
  parent,
  add_data 
)
Value:
CreateWindowEx(class_name, caption, style, 0, \
id, x, y, w, h, parent, add_data)
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.
Definition: window.h:7536

A simplified version of CreateWindowEx.

See also
CreateWindowEx

Definition at line 7624 of file window.h.

Typedef Documentation

typedef void(* NOTIFPROC)(HWND hwnd, LINT id, int nc, DWORD add_data)

Type of the notification callback procedure.

This is the function type of Notification Callback Procedure. If you set the Notification Callback Procedure for a control, when a notification occurred the control will call this callback procedure.

Note
The type of id changed from int to LINT since v3.2.
See also
SetNotificationCallback

Definition at line 7572 of file window.h.

Function Documentation

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

See also
CreateWindowEx2

Definition at line 7536 of file window.h.

References CreateWindowEx2(), DestroyWindow(), and NULL.

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.

Parameters
spClassNameThe class name of the control.
spCaptionThe caption of the control.
dwStyleThe control style.
dwExStyleThe extended control style.
idThe identifier of the control.
xx,y: The initial position of the control in the parent window.
yx,y: The initial position of the control in the parent window.
wThe initial width of the control.
hThe initial height of the control.
hParentWndThe handle to the parent window.
werdr_nameThe window renderer name. NULL for default renderer.
we_attrsThe pointer to window element attribute table. NULL for default attribute table.
dwAddDataThe 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.
Returns
The handle to the new control, HWND_INVALID on error.
See also
CreateWindowEx, CreateMainWindow, CTRLDATA

Referenced by CreateWindowEx().

BOOL GUIAPI DestroyWindow ( HWND  hWnd)

Destroys a specified control.

This function destroys the specified control hWnd, which is created by CreateWindowEx or CreateWindowEx2.

Parameters
hWndThe handle to the control.
Returns
TRUE on success, FALSE on error.
See also
CreateWindowEx

Referenced by CreateWindowEx().

NOTIFPROC GUIAPI GetNotificationCallback ( HWND  hwnd)

Gets the notification callback procedure of a control.

This function gets the new notification callback procedure of the control of hwnd.

Parameters
hwndThe handle to the control.
Returns
The notification callback procedure.
See also
NOTIFPROC, SetNotificationCallback
NOTIFPROC GUIAPI SetNotificationCallback ( HWND  hwnd,
NOTIFPROC  notif_proc 
)

Sets a new notification callback procedure for a control.

This function sets the new notification callback procedure (notif_proc) for the control of hwnd.

By default, the notification from a control will be sent to its parent window within a MSG_COMMAND messsage.

Since version 1.2.6, MiniGUI defines the Notification Callback Procedure for control. You can specify a callback function for a control by calling SetNotificationCallback to receive and handle the notifications from the control.

If you did not set the notification callback function for a control, the notification will be sent to its parent as same as the earlier version of MiniGUI.

Parameters
hwndThe handle to the control.
notif_procThe new notification callback procedure, can be NULL.
Returns
The old notification callback procedure.
See also
NOTIFPROC, GetNotificationCallback