WM_SYSCOMMAND --------------------- CWnd::OnSysCommand afx_msg void OnSysCommand( UINT nID, LPARAM lParam );ParametersnIDSpecifies the type of system command requested. This parameter can be any one of the following values: SC_CLOSE Close the CWnd object. SC_HOTKEY Activate the CWnd object associated with the application-specified hot key. The low-order word of lParam identifies the HWND of the window to activate. SC_HSCROLL Scroll horizontally. SC_KEYMENU Retrieve a menu through a keystroke. SC_MAXIMIZE (or SC_ZOOM) Maximize the CWnd object. SC_MINIMIZE (or SC_ICON) Minimize the CWnd object. SC_MOUSEMENU Retrieve a menu through a mouse click. SC_MOVE Move the CWnd object. SC_NEXTWINDOW Move to the next window. SC_PREVWINDOW Move to the previous window. SC_RESTORE Restore window to normal position and size. SC_SCREENSAVE Executes the screen-saver application specified in the [boot] section of the SYSTEM.INI file. SC_SIZE Size the CWnd object. SC_TASKLIST Execute or activate the Windows Task Manager application. SC_VSCROLL Scroll vertically. lParamIf a Control-menu command is chosen with the mouse, lParam contains the cursor coordinates. The low-order word contains the x coordinate, and the high-order word contains the y coordinate. Otherwise this parameter is not used. SC_HOTKEY Activate the window associated with the application-specified hot key. The low-order word of lParam identifies the window to activate. SC_SCREENSAVE Execute the screen-save application specified in the Desktop section of Control Panel.
uCmdType = wParam; // type of system command requested
xPos = LOWORD(lParam); // horizontal position, in screen coordinates
yPos = HIWORD(lParam); // vertical position, in screen coordinates 这里wParam= SC_MINIMIZE //Minimizes the window
{ MessageBox(TEXT("OnQueryOpen"),TEXT("Hello World"),MB_YESNO);
PostMessage(WM_LBUTTONDOWN);
return TRUE;
}
---------------------
CWnd::OnSysCommand
afx_msg void OnSysCommand( UINT nID, LPARAM lParam );ParametersnIDSpecifies the type of system command requested. This parameter can be any one of the following values: SC_CLOSE Close the CWnd object.
SC_HOTKEY Activate the CWnd object associated with the application-specified hot key. The low-order word of lParam identifies the HWND of the window to activate.
SC_HSCROLL Scroll horizontally.
SC_KEYMENU Retrieve a menu through a keystroke.
SC_MAXIMIZE (or SC_ZOOM) Maximize the CWnd object.
SC_MINIMIZE (or SC_ICON) Minimize the CWnd object.
SC_MOUSEMENU Retrieve a menu through a mouse click.
SC_MOVE Move the CWnd object.
SC_NEXTWINDOW Move to the next window.
SC_PREVWINDOW Move to the previous window.
SC_RESTORE Restore window to normal position and size.
SC_SCREENSAVE Executes the screen-saver application specified in the [boot] section of the SYSTEM.INI file.
SC_SIZE Size the CWnd object.
SC_TASKLIST Execute or activate the Windows Task Manager application.
SC_VSCROLL Scroll vertically.
lParamIf a Control-menu command is chosen with the mouse, lParam contains the cursor coordinates. The low-order word contains the x coordinate, and the high-order word contains the y coordinate. Otherwise this parameter is not used. SC_HOTKEY Activate the window associated with the application-specified hot key. The low-order word of lParam identifies the window to activate.
SC_SCREENSAVE Execute the screen-save application specified in the Desktop section of Control Panel.