Jump to content

WM SYSCOMMAND: Difference between revisions

From EDM2
No edit summary
No edit summary
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
This message occurs when a control window has a significant event to notify to its owner, or when a key stroke has been translated by an accelerator table into a WM_SYSCOMMAND.
This message is posted to the queue of the owner of the control, thereby offering it the opportunity to perform some activity as a result.
 
;For Frame Control Window Processing
:This message occurs when a control window has a significant event to notify to its owner, or when a key stroke has been translated by an accelerator table into a WM_SYSCOMMAND.


;In Button Control Window Processing
;In Button Control Window Processing
Line 5: Line 8:


;In Menu Control Window Processing
;In Menu Control Window Processing
The menu control window procedure sets uscmd to the menu-item identity.  
:The menu control window procedure sets uscmd to the menu-item identity.  


;In Title Bar Controls
;In Title Bar Controls
Line 24: Line 27:
==Parameters==
==Parameters==
===Default===
===Default===
;uscmd (USHORT)
:Command value.
:The command value can be one of the SC_* values. It is the responsibility of the application to be able to relate uscmd to an application function.
;ussource (USHORT)
:Source type.
:Identifies the type of control:
:;CMDSRC_PUSHBUTTON
::Posted by a push-button control. uscmd is the window identifier of the push button.
:;CMDSRC_MENU
::Posted by a menu control. uscmd is the identifier of the menu item.
:;CMDSRC_ACCELERATOR
::Posted as the result of an accelerator. uscmd is the accelerator command value.
:;CMDSRC_OTHER
::Other source. uscmd gives further control-specific information defined for each control type.
;uspointer (USHORT)
:Pointing-device indicator.
:;TRUE
::The message is posted as a result of a pointing-device operation.
:;FALSE
::The message is posted as a result of a keyboard operation.
===For Frame Control Window Processing===


;uscmd (USHORT)
;uscmd (USHORT)
Line 84: Line 112:
::The message is posted as a result of a keyboard operation.  
::The message is posted as a result of a keyboard operation.  


===In Default Window Procedure Message Processing===
;uscmd (USHORT)
:Command value.
:The command value can be one of the SC_* values. It is the responsibility of the application to be able to relate uscmd to an application function.
;ussource (USHORT)
:Source type.
:Identifies the type of control:
:;CMDSRC_PUSHBUTTON
::Posted by a push-button control. uscmd is the window identifier of the push button.
:;CMDSRC_MENU
::Posted by a menu control. uscmd is the identifier of the menu item.
:;CMDSRC_ACCELERATOR
::Posted as the result of an accelerator. uscmd is the accelerator command value.
:;CMDSRC_OTHER
::Other source. uscmd gives further control-specific information defined for each control type.
;uspointer (USHORT)
:Pointing-device indicator.
:;TRUE
::The message is posted as a result of a pointing-device operation.
:;FALSE
::The message is posted as a result of a keyboard operation.


           
==Returns==
==Returns==
;ulReserved (ULONG)
;ulReserved (ULONG)
Line 115: Line 118:


==Remarks==
==Remarks==
;Default
:This message is posted to the queue of the owner of the control, thereby offering it the opportunity to perform some activity as a result.
;For Frame Control Window Processing
This message is posted to the window procedure of the owner of the frame control. ulReserved is set to 0.  
This message is posted to the window procedure of the owner of the frame control. ulReserved is set to 0.  



Latest revision as of 23:10, 9 April 2025

This message is posted to the queue of the owner of the control, thereby offering it the opportunity to perform some activity as a result.

For Frame Control Window Processing
This message occurs when a control window has a significant event to notify to its owner, or when a key stroke has been translated by an accelerator table into a WM_SYSCOMMAND.
In Button Control Window Processing
Button control sets uscmd to the button identity.
In Menu Control Window Processing
The menu control window procedure sets uscmd to the menu-item identity.
In Title Bar Controls
The title bar control window procedure sets uscmd to the title bar control identity and ussource to CMDSRC_OTHER.
In Default Window Procedure Message Processing
This message occurs when a control has a significant event to report to its owner or when a key stroke has been translated by an accelerator table.

Syntax

param1
     USHORT  uscmd       /*  Command value. */

param2
     USHORT  ussource    /*  Source type. */
     BOOL    fpointer    /*  Pointing-device indicator. */

Parameters

Default

uscmd (USHORT)
Command value.
The command value can be one of the SC_* values. It is the responsibility of the application to be able to relate uscmd to an application function.
ussource (USHORT)
Source type.
Identifies the type of control:
CMDSRC_PUSHBUTTON
Posted by a push-button control. uscmd is the window identifier of the push button.
CMDSRC_MENU
Posted by a menu control. uscmd is the identifier of the menu item.
CMDSRC_ACCELERATOR
Posted as the result of an accelerator. uscmd is the accelerator command value.
CMDSRC_OTHER
Other source. uscmd gives further control-specific information defined for each control type.
uspointer (USHORT)
Pointing-device indicator.
TRUE
The message is posted as a result of a pointing-device operation.
FALSE
The message is posted as a result of a keyboard operation.

For Frame Control Window Processing

uscmd (USHORT)
Command value.
The frame control takes the action described on these uscmd values:
SC_SIZE
Sends a WM_TRACKFRAME (in Frame Controls) to the frame window.
SC_MOVE
Sends a WM_TRACKFRAME (in Frame Controls) to the frame window.
SC_MINIMIZE
If a control with the identifier FID_MINMAX is present, minimizes the frame window; otherwise nothing is done.
SC_MAXIMIZE
If a control with the identifier FID_MINMAX is present, maximizes the frame window; otherwise nothing is done.
When a window is moved or sized in the normal way at least one border should remain on the screen. When a window is maximized and the maximum size is as large as the screen, all borders should be positioned just outside the screen.
SC_RESTORE
If a control with the identifier FID_MINMAX is present, restores a maximized or minimized frame window to its previous size and position; otherwise nothing is done.
SC_NEXT
Cycles the active window status to the next main window.
SC_APPMENU
Sends a MM_STARTMENUMODE message to the control with the identifier FID_MENU.
SC_SYSMENU
Sends a MM_STARTMENUMODE message to the control with the identifier FID_SYSMENU.
SC_CLOSE
If Close is not enabled in the system menu, this message is ignored. Otherwise the frame posts a WM_CLOSE message to the client if it exists or to itself, if not.
SC_NEXTFRAME
The next frame window that is a child of the desktop window is activated.
SC_NEXTWINDOW
The next window with the same owner window is activated.
SC_TASKMANAGER
The Task List is activated.
SC_HELPEXTENDED
The frame manager sends HM_EXT_HELP to the associated Help Manager Object Window. If there is no such associated window, the original message is sent to the client.
SC_HELPKEYS
The frame manager sends HM_KEYS_HELP to the associated Help Manager Object Window. If there is no such associated window, the original message is sent to the client.
SC_HELPINDEX
The frame manager sends HM_HELP_INDEX to the associated Help Manager Object Window. If there is no such associated window, the original message is sent to the client.
SC_HIDE
Sets the visibility state of the frame window to off causing it to appear hidden or invisible.
ussource (USHORT)
Source type.
Identifies the type of control:
CMDSRC_PUSHBUTTON
Posted by a push-button control: uscmd is the window identifier of the push button.
CMDSRC_MENU
Posted by a menu control: uscmd is the identifier of the menu item.
CMDSRC_ACCELERATOR
Posted as the result of an accelerator: uscmd is the accelerator command value.
CMDSRC_OTHER
Other source: uscmd gives further control-specific information defined for each control type.
fpointer (BOOL)
Pointing-device indicator.
TRUE
The message is posted as a result of a pointing-device operation.
FALSE
The message is posted as a result of a keyboard operation.


Returns

ulReserved (ULONG)
Reserved value, should be 0.

Remarks

Default
This message is posted to the queue of the owner of the control, thereby offering it the opportunity to perform some activity as a result.
For Frame Control Window Processing

This message is posted to the window procedure of the owner of the frame control. ulReserved is set to 0.

For Button Control Window Processing
If the button control is specified with a style of BS_SYSCOMMAND but not with BS_HELP, the button control generates this message and posts it to the queue of its owner when a push button is pressed, or when it receives a BM_CLICK message.
For Menu Control Window Processing
The menu control window procedure generates this message and posts it to the queue of its owner, when an item is selected that has the style of MIS_SYSCOMMAND, but only if the WM_MENUSELECT (in Menu Controls) message returns a rc of TRUE.
In Title Bar Controls
The title bar control window procedure generates this message when a mouse input message is received. The window procedure posts the message to the queue of the window owner.
The purpose of this message is to notify the owner window to maximize or restore depending on its current state.

Default Processing

The default window procedure takes no action on this message, other than to set ulReserved to 0.

Related Messages