请问如何捕捉关机信息,我上次在网吧用API写一个关机的东东,那个网吧管理软件不让我关机,弹出警告框如何作到的?
解决方案 »
- 求助:优化循环嵌套
- 急~~~~请问:PageControl中的页面转换中如何加快捷键切换页面?
- 送分!!!!如何在程序开始时,创建sql server数据库??????????????????
- 请问一个指针概念性问题
- 如何屏蔽Win键?急需!在先等待,成功马上送分。
- 我老爸的腿摔坏了,郁闷!
- 在运行期怎样判断一个窗体已经打开?
- 代码来了,大家快来下载啊!我是 兔子(Rabbit1125)!
- 关于Object Pascal中类方法 class procedure
- 有关注册表的读写
- 谁知道哪儿有支持认证的SMTP组件下载?
- 如何将程序中的ICO图标显示到TBitbtn 的按钮上?(即把ICO格式文件转成BMP格式文件)
nSource = (UINT) wParam; // source of end-session request
fLogOff = lParam // logoff flag
ParametersnSourceReserved for future use. fLogOffValue of lParam. Indicates whether the user is logging off or shutting down the system. Supported values include: ENDSESSION_LOGOFF. Return ValuesIf an application can terminate conveniently, it should return TRUE; otherwise, it should return FALSE. ResBy default, the DefWindowProc function returns TRUE for this message.
Windows NT: When an application returns TRUE for this message, it receives the WM_ENDSESSION message and it is terminated, regardless of how the other applications respond to the WM_QUERYENDSESSION message.
Windows 95: After all applications return TRUE for this message, they receive the WM_ENDSESSION and they are terminated. See AlsoDefWindowProc, ExitWindows, WM_ENDSESSION
看着吧 眼睛瞪大点 以下是一个简单的阻止关机的程序 适用9X
unit Unit1;interfaceuses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;type
TForm1 = class(TForm)
private
{ Private declarations }
public
//下面是最重要的一句 映射关机消息到一个过程
procedure windowsclose(var msg:tmessage);message wm_queryendsession;
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.DFM}procedure tform1.windowsclose(var msg:tmessage);
begin
msg.result:=1;//不记得是1还是0自己试
end;
end.
没学多久DELPHI有很多地方不懂,还请大家多多指教
begin
if messagebox(handle,pchar('真的要关么?'),pchar('提示'),MB_OKCANCEL or MB_ICONQUESTION)=1 then msg.result:=1
else msg.result:=0;
end;