MiniGUI API Reference (MiniGUI-Processes)  v5.0.6
A mature and proven cross-platform GUI system for embedded and smart IoT devices
Macros
Dialog and control messages

Macros

#define MSG_COMMAND   0x0120
 The command message, indicates a notification message from child window, or the user has selected a menu item. More...
 
#define MSG_SYSCOMMAND   0x0121
 The system command message. More...
 
#define MSG_GETDLGCODE   0x0122
 Get dialog code. More...
 
#define MSG_INITDIALOG   0x0123
 Ready to initialize the controls in a dialog box. More...
 
#define MSG_DLG_GETDEFID   0x0126
 Get default push button ID first. More...
 
#define MSG_DLG_SETDEFID   0x0127
 Set default push button ID first. More...
 
#define MSG_ISDIALOG   0x0128
 Send to a window to query whether the window is a dialog window. More...
 
#define MSG_INITPAGE   0x0129
 Ready to initialize the controls in a property page. More...
 
#define MSG_SHOWPAGE   0x012A
 Indicates the page will be shown or hidden. More...
 
#define MSG_SHEETCMD   0x012B
 Indicates that a PSM_SHEETCMD message had been sent to the PropertySheet control. More...
 
#define MSG_INITCONTAINER   0x012C
 This message will be sent to the container window procedure after the container window is created. More...
 
#define MSG_SVCONTCMD   0x012D
 This message will be sent to the parent of the ScrollView control when the container of the ScrollView control reveived a MSG_COMMAND message. More...
 
#define MSG_FREEZECTRL   0x012E
 Send this message to freeze or thaw the paint action of the control. More...
 
#define MSG_FONTCHANGING   0x0130
 Indicates the user is trying to change the font of the window. More...
 
#define MSG_FONTCHANGED   0x0131
 Indicates the window font has been changed. More...
 
#define MSG_GETTEXTLENGTH   0x0132
 Send to the control or the main/virtual window to get the length of the text or caption. More...
 
#define MSG_GETTEXT   0x0133
 Send to the control to get the text, or send to the main/virtual window to get the caption. More...
 
#define MSG_SETTEXT   0x0134
 Send to the control to set the text, or send to the main/virtual window to set the caption. More...
 
#define MSG_ENABLE   0x0135
 Indicates the window is disabled/enabled. More...
 
#define MSG_NOTIFICATION   0x0136
 Indicate a notification message. More...
 

Detailed Description

Macro Definition Documentation

◆ MSG_COMMAND

#define MSG_COMMAND   0x0120

The command message, indicates a notification message from child window, or the user has selected a menu item.

This message sent to the window when the user has selected a menu item, or a child window has sent a notification message to the parent.

int id = LOWORD(wParam);
int code = HIWORD(wParam);
HWND hwnd = (HWND)lParam;
Parameters
idThe identifier of the menu item or the child window.
codeThe notification code.
hwndThe handle to the control.
Note
If you use MSG_COMMAND message to handle the notification sent from other windows, you should make sure the identifier value and the notification code do not exceed half of the maximal value of a DWORD (32-bit on 64-bit platform, and 16-bit on 32-bit platform). If you use a pointer as the identifier, the code above will not work.

Instead, we recommend strongly that you use a NOTIFYPOROC callback to handle the notification generated by a window.

See also
NotifyWindow, NotifyParentEx, SetNotificationCallback

Definition at line 2547 of file window.h.

◆ MSG_DLG_GETDEFID

#define MSG_DLG_GETDEFID   0x0126

Get default push button ID first.

Definition at line 2597 of file window.h.

◆ MSG_DLG_SETDEFID

#define MSG_DLG_SETDEFID   0x0127

Set default push button ID first.

Definition at line 2603 of file window.h.

◆ MSG_ENABLE

#define MSG_ENABLE   0x0135

Indicates the window is disabled/enabled.

This message is sent to the window if the window has been disabled or enabled.

BOOL enabled = (BOOL)wParam;
Parameters
enabledIndicates whether the window was disabled or enabled.

Definition at line 2861 of file window.h.

◆ MSG_FONTCHANGED

#define MSG_FONTCHANGED   0x0131

Indicates the window font has been changed.

This message is sent to the window after the window font has changed. Some window should be repainted to reflect the new window font.

Definition at line 2776 of file window.h.

◆ MSG_FONTCHANGING

#define MSG_FONTCHANGING   0x0130

Indicates the user is trying to change the font of the window.

This message is sent to the window when the user is trying to change the font of the window by calling SetWindowFont. If you return non-zero after handling this message, SetWindowFont will return immediately, i.e., the default window font will not change.

PLOGFONT log_font = (PLOGFONT)lParam;
Parameters
log_fontThe pointer to the new window logical font.
See also
SetWindowFont

Definition at line 2766 of file window.h.

◆ MSG_FREEZECTRL

#define MSG_FREEZECTRL   0x012E

Send this message to freeze or thaw the paint action of the control.

BOOL bFrozen;
wParam = bFrozen
lParam = 0;
Note
Note that implemented only in scrollview and listview.
Parameters
bFrozento freeze or to thaw.

Definition at line 2746 of file window.h.

◆ MSG_GETDLGCODE

#define MSG_GETDLGCODE   0x0122

Get dialog code.

Definition at line 2559 of file window.h.

◆ MSG_GETTEXT

#define MSG_GETTEXT   0x0133

Send to the control to get the text, or send to the main/virtual window to get the caption.

This message is sent to the control or the main/virtual window when you call GetWindowText function to get the text or the caption.

int max_len;
char* text_buf;
wParam = (WPARAM)max_len;
lParam = (LPARAM)text_buf;
Parameters
max_lenThe maximal number of characters can be copied to the buffer.
text_bufThe pointer to a buffer receives the text.
Returns
The length of the window text string.
See also
GetWindowText

Definition at line 2822 of file window.h.

◆ MSG_GETTEXTLENGTH

#define MSG_GETTEXTLENGTH   0x0132

Send to the control or the main/virtual window to get the length of the text or caption.

This message is sent to the control or the main/virtual window when you call GetWindowTextLength function to get the lenght of the text or the caption.

wParam = 0;
lParam = 0;
Returns
The length of the text.
See also
GetWindowTextLength

Definition at line 2797 of file window.h.

◆ MSG_INITCONTAINER

#define MSG_INITCONTAINER   0x012C

This message will be sent to the container window procedure after the container window is created.

This message is sent to the container in order that you can initialize the controls in the container.

DWORD add_data = (DWORD)lParam;
Parameters
add_dataThe additional data in CONTAINERINFO structure passed through the argument of dwAddData when creating the ScrollView control by calling CreateWindowEx.
See also
ScrollView control, CONTAINERINFO

Definition at line 2696 of file window.h.

◆ MSG_INITDIALOG

#define MSG_INITDIALOG   0x0123

Ready to initialize the controls in a dialog box.

This message is sent to the dialog in order that you can initialize the controls in the dialog box.

HWND focus_hwnd = (HWND)wParam;
LPARAM lparam = (LPARAM)lParam;
Parameters
focus_hwndThe handle to the control which will gain the input focus.
lparamThe parameter passed into the dialog box through DialogBoxIndirectParam function.
Returns
Returns non-zero value to set the input focus to focus_hwnd, else do not set focus.
See also
DialogBoxIndirectParam

Example:

static LRESULT DepInfoBoxProc (HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
struct _DepInfo *info;
switch(message) {
{
/*
* Get the lParam passed to this dialog box, and assign it
* to the second private additional data assoiciated
* with the dialog box.
*/
info = (struct _DepInfo*)lParam;
break;
}
{
/*
* Get the parameter from the second private data assoiciated
* with the dialog box.
*/
info = (struct _DepInfo*) GetWindowAdditionalData2 (hDlg);
switch(wParam) {
case IDOK:
/* Use the data in the parameter. */
......
case IDCANCEL:
EndDialog(hDlg,wParam);
break;
}
}
}
return DefaultDialogProc (hDlg, message, wParam, lParam);
}

Definition at line 2587 of file window.h.

◆ MSG_INITPAGE

#define MSG_INITPAGE   0x0129

Ready to initialize the controls in a property page.

This message is sent to the page in order that you can initialize the controls in the page.

DWORD add_data = (DWORD)lParam;
Parameters
add_dataThe additional data in DLGTEMPLATE structure passed through PSM_ADDPAGE message.
See also
PropertySheet control

Definition at line 2632 of file window.h.

◆ MSG_ISDIALOG

#define MSG_ISDIALOG   0x0128

Send to a window to query whether the window is a dialog window.

Note
This is a asynchronical message.

Definition at line 2613 of file window.h.

◆ MSG_NOTIFICATION

#define MSG_NOTIFICATION   0x0136

Indicate a notification message.

This message is an internal message which indicates the message is a notification sent by calling NotifyWindow or NotifyParentEx functions.

For this message, DispatchMessage function will call the notification callback procedure if the target window has been set the notification callback procedure, or convert the message to a MSG_COMMAND message and pass it to the window procedure.

LINT id = (LINT)wParam;
int nc = (int)lParam;
DWORD adData = msg->time;

Since 5.0.0.

See also
MSG_COMMAND, SetNotificationCallback, NotifyWindow, NotifyParentEx

Definition at line 2886 of file window.h.

◆ MSG_SETTEXT

#define MSG_SETTEXT   0x0134

Send to the control to set the text, or send to the main/virtual window to set the caption.

This message is sent to the control or the main/virtual window when you call SetWindowText function to set the text or the caption.

char* text_buf;
wParam = 0;
lParam = (LPARAM)text_buf;
Parameters
text_bufThe pointer to a buffer contains the text.
Returns
The return value is equal to zero if the text is set.
See also
SetWindowText

Definition at line 2846 of file window.h.

◆ MSG_SHEETCMD

#define MSG_SHEETCMD   0x012B

Indicates that a PSM_SHEETCMD message had been sent to the PropertySheet control.

This message is sent to the property page when the property sheet contains the page received the PSM_SHEETCMD message.

WPARAM param1 = wParam;
LPARAM param2 = lParam;
Parameters
param1The wParam of PSM_SHEETCMD message.
param2The lParam of PSM_SHEETCMD message.
See also
PropertySheet control, PSM_SHEETCMD

Definition at line 2675 of file window.h.

◆ MSG_SHOWPAGE

#define MSG_SHOWPAGE   0x012A

Indicates the page will be shown or hidden.

This message is sent to the page when the page will be shown or hidden.

HWND focus_hwnd = (HWND)wParam;
int show_cmd = (int)lParam;
Parameters
focus_hwndThe handle to the child which will gain the input focus if showing the page.
show_cmdThe show command, can be one of the following values:
  • SW_SHOW
    The page will be shown.
  • SW_HIDE
    The page will be hidden.
See also
PropertySheet control

Definition at line 2654 of file window.h.

◆ MSG_SVCONTCMD

#define MSG_SVCONTCMD   0x012D

This message will be sent to the parent of the ScrollView control when the container of the ScrollView control reveived a MSG_COMMAND message.

This message will be sent to the parent of the ScrollView when the container of the ScrollView control reveived a MSG_COMMAND message. Generally, the notification of the child control in the container will be sent via MSG_COMMAND to the container. If you have not defined your own window procedure for the container, this message gives a chance for the parent of the ScrollView control to handle the notifications come from the controls in the container.

Note that you can also define your window procedure for the container, and handle the notification from the child control in this procedure.

WPARAM param1 = wParam;
WPARAM param2 = lParam;
Parameters
param1The wParam of MSG_COMMAND message.
param2The lParam of MSG_COMMAND message.
See also
ScrollView control, MSG_COMMAND

Definition at line 2726 of file window.h.

◆ MSG_SYSCOMMAND

#define MSG_SYSCOMMAND   0x0121

The system command message.

Definition at line 2553 of file window.h.

MSG_COMMAND
#define MSG_COMMAND
The command message, indicates a notification message from child window, or the user has selected a m...
Definition: window.h:2547
DWORD
DWORD_PTR DWORD
A unsigned long type definition for pointer precision.
Definition: common.h:604
EndDialog
MG_EXPORT BOOL GUIAPI EndDialog(HWND hDlg, int endCode)
Destroys a modal dialog box, causing MiniGUI to end any processing for the dialog box.
HWND
GHANDLE HWND
Handle to main window or control.
Definition: common.h:407
MSG_ENABLE
#define MSG_ENABLE
Indicates the window is disabled/enabled.
Definition: window.h:2861
MSG_SHEETCMD
#define MSG_SHEETCMD
Indicates that a PSM_SHEETCMD message had been sent to the PropertySheet control.
Definition: window.h:2675
_LOGFONT
Definition: gdi.h:6478
DefaultDialogProc
#define DefaultDialogProc
The default dialog box procedure.
Definition: window.h:7401
WPARAM
UINT_PTR WPARAM
A type definition for the first message paramter.
Definition: common.h:706
LRESULT
LONG_PTR LRESULT
Signed result of message processing.
Definition: common.h:583
UINT
unsigned int UINT
A type definition for unsigned integer.
Definition: common.h:664
MSG_GETTEXT
#define MSG_GETTEXT
Send to the control to get the text, or send to the main/virtual window to get the caption.
Definition: window.h:2822
LINT
LONG_PTR LINT
Signed integer which has pointer precision.
Definition: common.h:577
BOOL
int BOOL
A type definition for boolean value.
Definition: common.h:343
MSG_NOTIFICATION
#define MSG_NOTIFICATION
Indicate a notification message.
Definition: window.h:2886
PLOGFONT
LOGFONT * PLOGFONT
Data type of pointer to a LOGFONT.
Definition: gdi.h:6513
MSG_INITDIALOG
#define MSG_INITDIALOG
Ready to initialize the controls in a dialog box.
Definition: window.h:2587
MSG_INITCONTAINER
#define MSG_INITCONTAINER
This message will be sent to the container window procedure after the container window is created.
Definition: window.h:2696
GetWindowAdditionalData2
MG_EXPORT DWORD GUIAPI GetWindowAdditionalData2(HWND hWnd)
Retrieve the second additional data of a window.
LOWORD
#define LOWORD(l)
Returns the low word of the double word l.
Definition: common.h:814
MSG_FONTCHANGING
#define MSG_FONTCHANGING
Indicates the user is trying to change the font of the window.
Definition: window.h:2766
HIWORD
#define HIWORD(l)
Returns the high word of the double word l.
Definition: common.h:821
MSG_SETTEXT
#define MSG_SETTEXT
Send to the control to set the text, or send to the main/virtual window to set the caption.
Definition: window.h:2846
MSG_GETTEXTLENGTH
#define MSG_GETTEXTLENGTH
Send to the control or the main/virtual window to get the length of the text or caption.
Definition: window.h:2797
MSG_SHOWPAGE
#define MSG_SHOWPAGE
Indicates the page will be shown or hidden.
Definition: window.h:2654
LPARAM
UINT_PTR LPARAM
A type definition for the second message paramter.
Definition: common.h:712
MSG_FREEZECTRL
#define MSG_FREEZECTRL
Send this message to freeze or thaw the paint action of the control.
Definition: window.h:2746
MSG_INITPAGE
#define MSG_INITPAGE
Ready to initialize the controls in a property page.
Definition: window.h:2632
SetWindowAdditionalData2
MG_EXPORT DWORD GUIAPI SetWindowAdditionalData2(HWND hWnd, DWORD newData)
Set the second additional data of a window.
MSG_SVCONTCMD
#define MSG_SVCONTCMD
This message will be sent to the parent of the ScrollView control when the container of the ScrollVie...
Definition: window.h:2726