private
procedure WMSysCommand(var Message: TWMSysCommand); message WM_SYSCOMMAND;procedure TLoadDownFrm.WMSysCommand(var Message: TWMSysCommand);
begin
IF (Message.CmdType = MAXIMIZE) Then
Begin
//问题2
End;
end;
出现如下错误提示:[Error] UpData.pas(84): Undeclared identifier: 'MAXIMIZE'晕倒了,用 SC_MINIMIZE 就行。这是怎么回事?
怎么写在出现最大化消息后,忽略该消息。窗体保持原状?
procedure WMSysCommand(var Message: TWMSysCommand); message WM_SYSCOMMAND;procedure TLoadDownFrm.WMSysCommand(var Message: TWMSysCommand);
begin
IF (Message.CmdType = MAXIMIZE) Then
Begin
//问题2
End;
end;
出现如下错误提示:[Error] UpData.pas(84): Undeclared identifier: 'MAXIMIZE'晕倒了,用 SC_MINIMIZE 就行。这是怎么回事?
怎么写在出现最大化消息后,忽略该消息。窗体保持原状?
WM_SYSCOMMAND
uCmdType = wParam; // type of system command requested
xPos = LOWORD(lParam); // horizontal postion, in screen coordinates
yPos = HIWORD(lParam); // vertical postion, in screen coordinates
ParametersuCmdTypeSpecifies the type of system command requested. This can be one of these values:Value Meaning
SC_CLOSE Closes the window.
SC_CONTEXTHELP Changes the cursor to a question 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 low-order word of lParam identifies the window to activate.
SC_HSCROLL Scrolls horizontally.
SC_KEYMENU Retrieves the window menu as a result of a keystroke.
SC_MAXIMIZE (or SC_ZOOM) Maximizes the window.
SC_MINIMIZE (or SC_ICON) Minimizes the window.
SC_MONITORPOWER Windows 95 only: Sets the state of the display. This command supports devices that have power-saving features, such as a battery-powered personal computer.
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 Executes or activates Windows Task Manager.
SC_VSCROLL Scrolls vertically.
xPosSpecifies 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.yPosSpecifies 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 mnenomic.procedure TForm1.WMSysCommand(var Message: TWMSysCommand);
begin
if Message.CmdType = SC_MAXIMIZE then
begin
Message.Result := 1;
Exit;
end;
inherited;
end;