📄 subject_44725.htm
字号:
<p>
序号:44725 发表者:剑月明 发表日期:2003-06-23 00:01:40
<br>主题:怎样重载标题栏上的最小化,关闭按钮消息啊?
<br>内容:急!!
<br><a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p>
<hr size=1>
<blockquote><p>
回复者:bird 回复日期:2003-06-23 09:04:16
<br>内容:最大化、最小化将发送WM_SYSCOMMAND消息。要处理该消息,可以这么做: <BR> 1、在Form的头文件中添加: <BR> void __fastcall RestrictMinimizeMaximize(TMessage &Msg); <BR> <BR> BEGIN_MESSAGE_MAP <BR> MESSAGE_HANDLER(WM_SYSCOMMAND, TMessage, RestrictMinimizeMaximize) <BR> END_MESSAGE_MAP(TForm) <BR> 2、在Form的单元文件中添加: <BR> <BR> void __fastcall TForm1::RestrictMinimizeMaximize(TMessage& Msg) <BR> { <BR> if (Msg.WParam == SC_MINIMIZE) <BR> { <BR> //catches minimize... <BR> } <BR> else if (Msg.WParam == SC_MAXIMIZE) <BR> { <BR> //catches maximize... <BR> } <BR> TForm::Dispatch(&Msg); <BR> // or "else TForm::Dispatch(&Msg)" to trap <BR> } <BR> 关闭窗口的消息为WM_CLOSE,C++Builder提供了OnClose事件
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
<font color=red>答案被接受</font><br>回复者:bird 回复日期:2003-06-23 09:04:29
<br>内容:你应该截取 WM_SYSCOMMAND消息。该消息参数为: <BR> uCmdType = wParam; // type of system command requested <BR> xPos = LOWORD(lParam); // horizontal postion, in screen coordinates <BR> yPos = HIWORD(lParam); // vertical postion, in screen coordinates <BR> 其中uCmdType表示用户的选择: <BR> SC_CLOSE Closes the window. <BR> 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. <BR> SC_DEFAULT Selects the default item; the user double-clicked the System menu. <BR> SC_HOTKEY Activates the window associated with the application-specified hot key. The low-order word of lParam identifies the window to activate. <BR> SC_HSCROLL Scrolls horizontally. <BR> SC_KEYMENU Retrieves the System menu as a result of a keystroke. <BR> SC_MAXIMIZE (or SC_ZOOM) Maximizes the window. <BR> SC_MINIMIZE (or SC_ICON) Minimizes the window. <BR> 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. <BR> SC_MOUSEMENU Retrieves the System menu as a result of a mouse click. <BR> SC_MOVE Moves the window. <BR> SC_NEXTWINDOW Moves to the next window. <BR> SC_PREVWINDOW Moves to the previous window. <BR> SC_RESTORE Restores the window to its normal position and size. <BR> SC_SCREENSAVE Executes the screen saver application specified in the [boot] section of the SYSTEM.INI file. <BR> SC_SIZE Sizes the window. <BR> SC_TASKLIST Executes or activates Windows Task Manager. <BR> SC_VSCROLL Scrolls vertically. <BR>
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:VChen 回复日期:2003-06-25 00:17:50
<br>内容:下载例子
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -