B book523 Unregistered / Unconfirmed GUEST, unregistred user! 2002-06-05 #1 我截获wm_size消息,可是好像窗体最小化时没有发出该消息,没有进入处理过程。<br>而最大化,以及窗体大小变化都能截获,就是最小化不能截获,为什么?<br>到底是什么消息啊?<br>
B BDFan Unregistered / Unconfirmed GUEST, unregistred user! 2002-06-05 #3 可以这样截取WM_SYSCOMMAND信息:<br><br>type<br>TForm1 = class(TForm)<br>public<br>procedure WMSysCommand(var Msg: TWMSysCommand); message WM_SYSCOMMAND;<br>end;<br><br>procedure TForm1.WMSysCommand;<br>begin<br>if (Msg.CmdType = SC_MINIMIZE) or (Msg.CmdType = SC_MAXIMIZE) then<br>begin<br>// 你的代码...<br>end;<br>DefaultHandler(Msg);<br>end;<br><br>
可以这样截取WM_SYSCOMMAND信息:<br><br>type<br>TForm1 = class(TForm)<br>public<br>procedure WMSysCommand(var Msg: TWMSysCommand); message WM_SYSCOMMAND;<br>end;<br><br>procedure TForm1.WMSysCommand;<br>begin<br>if (Msg.CmdType = SC_MINIMIZE) or (Msg.CmdType = SC_MAXIMIZE) then<br>begin<br>// 你的代码...<br>end;<br>DefaultHandler(Msg);<br>end;<br><br>