WM_QUERYENDSESSION消息为什么截获不到? ( 积分: 100 )

  • 主题发起人 主题发起人 ocean7
  • 开始时间 开始时间
O

ocean7

Unregistered / Unconfirmed
GUEST, unregistred user!
下面代码截获不到关机消息,没任何反映啊<br>interfaceuses <br> &nbsp;Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, &nbsp;<br>Dialogs; <br>type <br> &nbsp;TForm1 = class(TForm) &nbsp; <br> &nbsp;procedure FormCreate(Sender: TObject); &nbsp;private <br> &nbsp; &nbsp;{ Private declarations } <br> &nbsp; &nbsp;procedure winexit(var msg:Tmessage);message WM_QUERYENDSESSION; &nbsp;<br> public <br> &nbsp; &nbsp;{ Public declarations } &nbsp;<br> end; <br>var &nbsp;Form1: TForm1; <br>implementation <br>{$R *.DFM} <br>procedure TForm1.FormCreate(Sender: TObject);beginend; <br><br>procedure TForm1.winexit(var msg: Tmessage); <br>begin <br>showmessage('关机了!'); <br>end;
 
下面代码截获不到关机消息,没任何反映啊<br>interfaceuses <br> &nbsp;Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, &nbsp;<br>Dialogs; <br>type <br> &nbsp;TForm1 = class(TForm) &nbsp; <br> &nbsp;procedure FormCreate(Sender: TObject); &nbsp;private <br> &nbsp; &nbsp;{ Private declarations } <br> &nbsp; &nbsp;procedure winexit(var msg:Tmessage);message WM_QUERYENDSESSION; &nbsp;<br> public <br> &nbsp; &nbsp;{ Public declarations } &nbsp;<br> end; <br>var &nbsp;Form1: TForm1; <br>implementation <br>{$R *.DFM} <br>procedure TForm1.FormCreate(Sender: TObject);beginend; <br><br>procedure TForm1.winexit(var msg: Tmessage); <br>begin <br>showmessage('关机了!'); <br>end;
 
procedure CMQUERYENDSESSION(var Msg: TMessage); message WM_QUERYENDSESSION;<br><br>procedure TForm1.CMQUERYENDSESSION(var Msg: Tmessage);<br>begin<br> &nbsp;Showmessage('关机了哦!');<br>end;
 
好,帮顶<br><br><br> <br> --------签名档---------------------------<br> <br> 比肩国内顶尖源码下载站点 &nbsp;-&gt; 源码我爱你<br> <br> http://www.source520.com &nbsp; &nbsp; &nbsp; &nbsp; <br> http://www.source520.net<br><br> 80G源码电子书免费免注册下载,大量精辟技术文档库随时更新<br> ******************************************************************<br> 附:为了站点持续发展,现有本站近年来收藏的大量大型商业源码低价出售,<br> &nbsp; &nbsp;详情请进入以下链接查看:<br> &nbsp; &nbsp;http://www.source520.com/building_delphi.htm<br> &nbsp; &nbsp;<br> &nbsp; 浏览商业代码请从如下URL进入查看实物:<br> &nbsp; 1.商业源码库1: &nbsp; ftp://source520see3:browse@61.152.199.245/<br> &nbsp; 2.商业源码库2: &nbsp; ftp://source520see2:browse@61.152.199.245/
 
后退
顶部