Windows 在关闭时会向所有的应用程序发送WM_QUERYENDSESSION 消息WM_QUERYENDSESSION 结构
nSource = (UINT) wParam; // source of end-session request
fLogOff = lParam // logoff flag
nSource - Reserved for future use.
fLogOff - Value of lParam. Indicates whether the user is logging off or shutting down the system. // Delphi 中截获 WM_QUERYENDSESSION 消息private
procedure wmQUERYENDSESSION(var msg:tWMQUERYENDSESSION);message WM_QUERYENDSESSION;......procedure wmQUERYENDSESSION(var msg:tWMQUERYENDSESSION);
begin
// 这里加入你要处理的代码
end;
nSource = (UINT) wParam; // source of end-session request
fLogOff = lParam // logoff flag
nSource - Reserved for future use.
fLogOff - Value of lParam. Indicates whether the user is logging off or shutting down the system. // Delphi 中截获 WM_QUERYENDSESSION 消息private
procedure wmQUERYENDSESSION(var msg:tWMQUERYENDSESSION);message WM_QUERYENDSESSION;......procedure wmQUERYENDSESSION(var msg:tWMQUERYENDSESSION);
begin
// 这里加入你要处理的代码
end;
procedure wmQUERYENDSESSION(var msg:tWMQUERYENDSESSION);message WM_QUERYENDSESSION;
procedure TForm1.WmQUERYENDSESSION(VAR msg:tWMQUERYENDSESSION);
begin
msg.Result:=0;
end;
哈哈不能关机了
你的程序要结束没有响应的部分!
东方快车也有这个毛病!
To F4:我的程序按正常的方法关闭(如按系统菜单上的关闭)可以很正常的结束。现在我发现在“关闭Windows”的窗体上按下“是”后,Windows只是把“关闭Windows”这个窗体关闭了,其它啥也没做。