任务栏消息(50分)

  • 主题发起人 主题发起人 goease
  • 开始时间 开始时间
G

goease

Unregistered / Unconfirmed
GUEST, unregistred user!
最小化窗体的时候,如果是单机任务栏上的按钮,那么发出的是什么消息呢?<br>&nbsp;不是放在托盘里的图标,而是一般的出现在任务栏上的程序标题,我想截获<br>这个消息,进行最小化处理,请大虾告知<br>
 
type <br>TForm1 = class(TForm) <br>private <br>{ Private declarations } <br>procedure WMSysCommand(var Msg: TWMSysCommand); <br>message WM_SYSCOMMAND; <br>public <br>{ Public declarations } <br>end; <br><br>var <br>Form1: TForm1; <br><br>implementation <br><br>{$R *.DFM} <br><br>procedure TForm1.WMSysCommand; <br>begin <br>if (Msg.CmdType = SC_MINIMIZE) or <br>(Msg.CmdType = SC_MAXIMIZE) then <br>MessageBeep(0) &nbsp;//写你要处理的代码<br>&nbsp;else <br>inherited; <br>end
 
type <br>&nbsp; TForm1 = class(TForm)<br>&nbsp; &nbsp; private<br>&nbsp; &nbsp; { Private declarations }<br>&nbsp; &nbsp; procedure Hellow(var Msg: TMessage);message WM_NCACTIVATE;<br>&nbsp; &nbsp; public<br>&nbsp; &nbsp; { Public declarations }<br>&nbsp; &nbsp; end;<br><br>var<br>Form1: TForm1;<br><br>implementation<br><br>{$R *.DFM}<br><br><br>procedure TForm1.Hellow(var Msg: TMessage);<br>begin<br><br>end;<br><br>end.
 
上面两个消息结构抓不住将窗口还原的消息。我用消息查看器,不过好久没用,不知道怎么察看单个程序所触发的消息了
 
后退
顶部