Форум: "WinAPI";
Поиск по всему сайту: delphimaster.net;
Текущий архив: 2002.03.04;
Скачать: [xml.tar.bz2];



Vovchik   (2002-01-04 12:37) [11]

В самом-то деле, я тоже это хотел сказать. Вот копия из SDK (извиняюсь, форматирование убилось):


A window receives this message when the user chooses a command from the window menu (formerly known as the system or control menu) or when the user chooses the maximize button, minimize button, restore button, or close button.


uCmdType = wParam; // type of system command requested
xPos = GET_X_LPARAM(lParam); // horizontal position, in screen coordinates
yPos = GET_Y_LPARAM(lParam); // vertical position, in screen coordinates



Specifies the type of system command requested. This parameter can be one of the following values. Value Meaning

SC_CLOSE Closes the window.

SC_CONTEXTHELP Changes the cursor to a question mark with a pointer. If the user then clicks a control in the dialog box, the control receives a WM_HELP message.

SC_DEFAULT Selects the default item; the user double-clicked the window menu.

SC_HOTKEY Activates the window associated with the application-specified hot key. The lParam identifies the window to activate.

SC_HSCROLL Scrolls horizontally.

SC_KEYMENU Retrieves the window menu as a result of a keystroke. For more information, see the Remarks section.

SC_MAXIMIZE Maximizes the window.

SC_MINIMIZE Minimizes the window.

SC_MONITORPOWER Sets the state of the display. This command supports devices that have power-saving features, such as a battery-powered personal computer.

lParam can have the following values:

1 means the display is going to low power.
2 means the display is being shut off.

SC_MOUSEMENU Retrieves the window menu as a result of a mouse click.

SC_MOVE Moves the window.
SC_NEXTWINDOW Moves to the next window.
SC_PREVWINDOW Moves to the previous window.
SC_RESTORE Restores the window to its normal position and size.
SC_SCREENSAVE Executes the screen saver application specified in the [boot] section of the System.ini file.
SC_SIZE Sizes the window.
SC_TASKLIST Activates the Start menu.
SC_VSCROLL Scrolls vertically.


Specifies the horizontal position of the cursor, in screen coordinates, if a window menu command is chosen with the mouse. Otherwise, the xPos parameter is not used.


Specifies the vertical position of the cursor, in screen coordinates, if a window menu command is chosen with the mouse. This parameter is –1 if the command is chosen using a system accelerator, or zero if using a mnemonic.

Return Values

An application should return zero if it processes this message.


The DefWindowProc function carries out the window menu request for the predefined actions specified in the previous table.

In WM_SYSCOMMAND messages, the four low-order bits of the uCmdType parameter are used internally by the system. To obtain the correct result when testing the value of uCmdType, an application must combine the value 0xFFF0 with the uCmdType value by using the bitwise AND operator.

The menu items in a window menu can be modified by using the GetSystemMenu, AppendMenu, InsertMenu, ModifyMenu, InsertMenuItem, and SetMenuItem functions. Applications that modify the window menu must process WM_SYSCOMMAND messages.

An application can carry out any system command at any time by passing a WM_SYSCOMMAND message to DefWindowProc. Any WM_SYSCOMMAND messages not handled by the application must be passed to DefWindowProc. Any command values added by an application must be processed by the application and cannot be passed to DefWindowProc.

Accelerator keys that are defined to choose items from the window menu are translated into WM_SYSCOMMAND messages; all other accelerator keystrokes are translated into WM_COMMAND messages.

If the wParam is SC_KEYMENU, the lParam contains the character code of the key that is used with the ALT key to display the popup menu. For example, pressing ALT+F to display the File popup will cause a WM_SYSCOMMAND with wParam equal to SC_KEYMENU and lParam equal to "f".


Windows NT/2000: Requires Windows NT 3.1 or later.
Windows 95/98: Requires Windows 95 or later.
Windows CE: Requires version 1.0 or later.
Header: Declared in winuser.h.

See Also

Keyboard Accelerators Overview, Keyboard Accelerator Messages, Power Management Overview, AppendMenu, DefWindowProc, GetSystemMenu, InsertMenu, ModifyMenu, WM_COMMAND

Форум: "WinAPI";
Поиск по всему сайту: delphimaster.net;
Текущий архив: 2002.03.04;
Скачать: [xml.tar.bz2];


Память: 0.75 MB
Время: 0.015 c
1-9181            Johnmen               2002-02-14 12:20  2002.03.04  
Кто плотно общался с DBGridEh ?

3-9070            amamed_3071           2002-01-21 11:41  2002.03.04  
Save Report (Qreport)

3-9087            Марина                2002-02-07 11:19  2002.03.04  
Выборка по частичному соответствию (LIKE)

1-9219            Стас                  2002-02-15 08:21  2002.03.04  
Про анимированный gif.

1-9233            staratel              2002-02-13 15:29  2002.03.04