MiniGUI API Reference (MiniGUI-Processes)  v5.0.6
A mature and proven cross-platform GUI system for embedded and smart IoT devices
Modules | Macros
User-machine Interaction messages

Modules

 Notification codes of srollbar control
 

Macros

#define MSG_SETCURSOR   0x0020
 Set cursor shape in the client area. More...
 
#define MSG_NCHITTEST   0x0021
 Hit test in non-client area. This is an async message. More...
 
#define MSG_HITTEST   MSG_NCHITTEST
 Hit test in non-client area. More...
 
#define MSG_CHANGESIZE   0x0022
 Change window size. More...
 
#define MSG_QUERYCLIENTAREA   0x0024
 Query client area. More...
 
#define MSG_SIZECHANGING   0x0025
 Indicates the size of the window is being changed. More...
 
#define MSG_SIZECHANGED   0x0026
 Indicates the size of the window has been changed. More...
 
#define MSG_CSIZECHANGED   0x0027
 Indicates the size of the client area of the window has been changed. More...
 
#define MSG_SETFOCUS   0x0030
 Indicates that the window has gained the input focus. More...
 
#define MSG_KILLFOCUS   0x0031
 Indicates that the window has lost the input focus. More...
 
#define MSG_MOUSEACTIVE   0x0032
 Indicates that the window has gained the input focus because the user clicked the window. More...
 
#define MSG_ACTIVE   0x0033
 Indicates that the window has gained the input focus because the user clicked the window. More...
 
#define MSG_CHILDHIDDEN   0x0034
 Hide child window. More...
 
#define MSG_ACTIVEMENU   0x0040
 Indicates that the user activates the menu bar and tracks it. More...
 
#define MSG_DEACTIVEMENU   0x0041
 Indicates the end of the tracking of a menu bar or a popup menu. More...
 
#define MSG_HSCROLL   0x0042
 Indicates that the user has clicked the horizontal scroll bar. More...
 
#define MSG_VSCROLL   0x0043
 Indicates that the user has clicked the vertical scroll bar. More...
 
#define MSG_NCSETCURSOR   0x0044
 Set cursor shape in the non-client area. More...
 
#define MSG_MOUSEMOVEIN   0x0050
 Indicates the mouse is moved in/out the area of the window. More...
 
#define MSG_WINDOWDROPPED   0x0051
 Indicates that user dropped window. server to client; (wParam, lParam): result rectangle. More...
 

Detailed Description

Macro Definition Documentation

◆ MSG_ACTIVE

#define MSG_ACTIVE   0x0033

Indicates that the window has gained the input focus because the user clicked the window.

This message is sent to the window procedure after the user clicked the window and it has gained the input focus.

Definition at line 1052 of file window.h.

◆ MSG_ACTIVEMENU

#define MSG_ACTIVEMENU   0x0040

Indicates that the user activates the menu bar and tracks it.

This message is sent to the window procedure when the user activates the menu bar and tracks it.

If you want to change the states of menu items in the submenu before displaying it, you can handle this message.

int pos = (int)wParam;
HMENU submenu = (HMENU)lParam;
Parameters
posThe position of the activated submenu. The position value of the first submenu is 0.
submenuThe handle to the activated submenu.

Example:

/*
* This handler checks the specified menu items to contain
* a radio bitmap by calling CheckMenuRadioItem function,
* if the submenu at position 2 has been activated.
*/
if (wParam == 2) {
IDM_40X15, IDM_CUSTOMIZE,
pConInfo->termType, MF_BYCOMMAND);
IDM_DEFAULT, IDM_BIG5,
pConInfo->termCharset, MF_BYCOMMAND);
}
break;

Definition at line 1088 of file window.h.

◆ MSG_CHANGESIZE

#define MSG_CHANGESIZE   0x0022

Change window size.

Definition at line 932 of file window.h.

◆ MSG_CHILDHIDDEN

#define MSG_CHILDHIDDEN   0x0034

Hide child window.

Definition at line 1058 of file window.h.

◆ MSG_CSIZECHANGED

#define MSG_CSIZECHANGED   0x0027

Indicates the size of the client area of the window has been changed.

This message is sent as a notification to the window when the size of the client area has been changed.

int client_width = (int)wParam;
int client_height = (int)lParam;
Parameters
client_widthThe width of the client area.
client_heightThe height of the client area.

Definition at line 1008 of file window.h.

◆ MSG_DEACTIVEMENU

#define MSG_DEACTIVEMENU   0x0041

Indicates the end of the tracking of a menu bar or a popup menu.

This message is sent to the window procedure when the user has closed the tracking menu bar or popup menu.

HMENU menubar = (HMENU)wParam;
HMENU submenu = (HMENU)lParam;
Parameters
menubarThe handle to the menu bar. It will be zero when the deactivated menu is a popup menu.
submenuThe handle to the submenu.

Definition at line 1107 of file window.h.

◆ MSG_HITTEST

#define MSG_HITTEST   MSG_NCHITTEST

Hit test in non-client area.

See also
MSG_NCHITTEST

Definition at line 926 of file window.h.

◆ MSG_HSCROLL

#define MSG_HSCROLL   0x0042

Indicates that the user has clicked the horizontal scroll bar.

This message is sent to the window procedure when the user has clicked the horizontal scroll bar and changed the position of the thumb.

int hs_nc = (int)wParam;
Parameters
hs_ncThe scrolling code, can be one of the following values:
  • SB_LINELEFT
    The user clicked the left arrow on the bar.
  • SB_LINERIGHT
    The user clicked the right arrow on the bar.
  • SB_PAGELEFT
    The user clicked the left page area on the bar.
  • SB_PAGERIGHT
    The user clicked the right page area on the bar.
  • SB_THUMBPOSITION
    The user set a new thumb position.
  • SB_THUMBTRACK
    The user is draging and tracking the thumb.
  • SB_ENDSCROLL
    The end of scrolling.

Definition at line 1235 of file window.h.

◆ MSG_KILLFOCUS

#define MSG_KILLFOCUS   0x0031

Indicates that the window has lost the input focus.

Parameters
lparamThe parameter passed into used for pass killfocus msg to child control if lparam > 0.

This message is sent to the window procedure after the window losts the input focus.

Definition at line 1032 of file window.h.

◆ MSG_MOUSEACTIVE

#define MSG_MOUSEACTIVE   0x0032

Indicates that the window has gained the input focus because the user clicked the window.

This message is sent to the window procedure after the user clicked the window and it has gained the input focus.

Definition at line 1042 of file window.h.

◆ MSG_MOUSEMOVEIN

#define MSG_MOUSEMOVEIN   0x0050

Indicates the mouse is moved in/out the area of the window.

This message is posted to the window when the user moves the mouse in/out the area of the window.

BOOL in_out = (BOOL)wParam;
Parameters
in_outIndicates whether the mouse has been moved in the window or out the window.

Definition at line 1296 of file window.h.

◆ MSG_NCHITTEST

#define MSG_NCHITTEST   0x0021

Hit test in non-client area. This is an async message.

Definition at line 918 of file window.h.

◆ MSG_NCSETCURSOR

#define MSG_NCSETCURSOR   0x0044

Set cursor shape in the non-client area.

This message is posted to the window under the cursor when the user moves the mouse in order to give the chance to change the cursor shape. The default handler set the cursor shape to the default cursor of the window. If you set a new cursor shape, your message handler should return immediately.

See also
MSG_SETCURSOR

Definition at line 1279 of file window.h.

◆ MSG_QUERYCLIENTAREA

#define MSG_QUERYCLIENTAREA   0x0024

Query client area.

Definition at line 941 of file window.h.

◆ MSG_SETCURSOR

#define MSG_SETCURSOR   0x0020

Set cursor shape in the client area.

This message is posted to the window under the cursor when the user moves the mouse in order to give the chance to change the cursor shape. The default handler set the cursor shape to the default cursor of the window. If you set a new cursor shape, your message handler should return immediately.

int cx = LOSWORD (lParam);
int cy = HISWORD (lParam);
Parameters
cx,cyThe client coordinates of the cursor.

Example:

/*
* The following MSG_SETCURSOR handler set the cursor
* shape to the arrow cursor when the window is disabled.
*/
if (GetWindowStyle (hwnd) & WS_DISABLED) {
return 0;
}
break;
See also
MSG_NCSETCURSOR

Definition at line 852 of file window.h.

◆ MSG_SETFOCUS

#define MSG_SETFOCUS   0x0030

Indicates that the window has gained the input focus.

Parameters
lparamThe parameter passed into used for pass setfocus msg to child control if lparam > 0.

This message is sent to the window procedure after the window gains the input focus.

Definition at line 1020 of file window.h.

◆ MSG_SIZECHANGED

#define MSG_SIZECHANGED   0x0026

Indicates the size of the window has been changed.

This message is sent to the window when the size has been changed. If you want adjust the size of the client area of the window, you should handle this message, change the values of the client area, and return non-zero value to indicate that the client area has been modified.

RECT* rcClient = (RECT*)lParam;
Parameters
rcClientThe pointer to a RECT structure which contains the new client area.

Example:

{
RECT* rcClient = (RECT*)lParam;
rcClient->right = rcClient->left + _WIDTH;
rcClient->bottom = rcClient->top + _HEIGHT;
return 1;
}

Definition at line 990 of file window.h.

◆ MSG_SIZECHANGING

#define MSG_SIZECHANGING   0x0025

Indicates the size of the window is being changed.

This message is sent to the window when the size is being changed. If you want to control the actual position and size of the window when the size is being changed (this may be caused by MoveWindow or other functions), you should handle this message, and return the actual position and size of the window through the second parameter.

const RECT* rcExpect = (const RECT*)wParam;
RECT* rcResult = (RECT*)lParam;
Parameters
rcExpectThe expected size of the window after changing.
rcResultThe actual size of the window after changing.

Example:

/*
* The handler set the actual size of the window always
* to be _WIDTH wide and _HEIGHT high.
*/
{
const RECT* rcExpect = (const RECT*)wParam;
RECT* rcResult = (RECT*)lParam;
rcResult->left = rcExpect->left;
rcResult->top = rcExpect->top;
rcResult->right = rcExpect->left + _WIDTH;
rcResult->bottom = rcExpect->top + _HEIGHT;
return 0;
}

Definition at line 966 of file window.h.

◆ MSG_VSCROLL

#define MSG_VSCROLL   0x0043

Indicates that the user has clicked the vertical scroll bar.

This message is sent to the window procedure when the user has clicked the vertical scroll bar and changed the position of the thumb.

int vs_nc = (int)wParam;
Parameters
vs_ncThe scrolling code, can be one of the following values:
  • SB_LINEUP
    The user clicked the up arrow on the bar.
  • SB_LINEDOWN
    The user clicked the down arrow on the bar.
  • SB_PAGEUP
    The user clicked the up page area on the bar.
  • SB_PAGEDOWN
    The user clicked the down page area on the bar.
  • SB_THUMBPOSITION
    The user set a new thumb position.
  • SB_THUMBTRACK
    The user is draging and tracking the thumb.
  • SB_ENDSCROLL
    The end of scrolling.

Definition at line 1265 of file window.h.

◆ MSG_WINDOWDROPPED

#define MSG_WINDOWDROPPED   0x0051

Indicates that user dropped window. server to client; (wParam, lParam): result rectangle.

Definition at line 1303 of file window.h.

SetCursor
#define SetCursor(hcsr)
Changes the current cursor.
Definition: minigui.h:4113
_RECT::right
int right
Definition: common.h:948
GetSystemCursor
MG_EXPORT HCURSOR GUIAPI GetSystemCursor(int csrid)
Get the handle to a system cursor by its identifier.
HISWORD
#define HISWORD(l)
Returns the high signed word of the double word l.
Definition: common.h:837
_RECT
Definition: common.h:936
IDC_ARROW
#define IDC_ARROW
Definition: minigui.h:3934
HMENU
GHANDLE HMENU
Handle to menu.
Definition: common.h:432
GetWindowStyle
MG_EXPORT DWORD GUIAPI GetWindowStyle(HWND hWnd)
Retrieve the style of a window.
MSG_CSIZECHANGED
#define MSG_CSIZECHANGED
Indicates the size of the client area of the window has been changed.
Definition: window.h:1008
MSG_SIZECHANGING
#define MSG_SIZECHANGING
Indicates the size of the window is being changed.
Definition: window.h:966
BOOL
int BOOL
A type definition for boolean value.
Definition: common.h:343
MSG_MOUSEMOVEIN
#define MSG_MOUSEMOVEIN
Indicates the mouse is moved in/out the area of the window.
Definition: window.h:1296
MSG_DEACTIVEMENU
#define MSG_DEACTIVEMENU
Indicates the end of the tracking of a menu bar or a popup menu.
Definition: window.h:1107
MSG_ACTIVEMENU
#define MSG_ACTIVEMENU
Indicates that the user activates the menu bar and tracks it.
Definition: window.h:1088
_RECT::bottom
int bottom
Definition: common.h:952
WS_DISABLED
#define WS_DISABLED
Creates a window initially disabled.
Definition: window.h:4298
LOSWORD
#define LOSWORD(l)
Returns the low signed word of the double word l.
Definition: common.h:830
MSG_HSCROLL
#define MSG_HSCROLL
Indicates that the user has clicked the horizontal scroll bar.
Definition: window.h:1235
MSG_SIZECHANGED
#define MSG_SIZECHANGED
Indicates the size of the window has been changed.
Definition: window.h:990
CheckMenuRadioItem
MG_EXPORT int GUIAPI CheckMenuRadioItem(HMENU hmnu, LINT first, LINT last, LINT checkitem, UINT flag)
Check a specified menu item and makes it a radio item.
_RECT::top
int top
Definition: common.h:944
MSG_SETCURSOR
#define MSG_SETCURSOR
Set cursor shape in the client area.
Definition: window.h:852
_RECT::left
int left
Definition: common.h:940