1、我想实现的功能是在屏保或休眠被唤醒时做一些事情,现在我的方法是捕捉这个唤醒消息,但是不知该如何捕捉,唤醒消息是什么,或者有没有别的方法。
2、我想从EXE中提取默认的最大的图标,例如,如果最大的是128*128就提取128的,否则64、32。请高手指教,并详细说明,最好有代码,分都加上了。
我的QQ是253817622,结识各路英雄好汉。
2、我想从EXE中提取默认的最大的图标,例如,如果最大的是128*128就提取128的,否则64、32。请高手指教,并详细说明,最好有代码,分都加上了。
我的QQ是253817622,结识各路英雄好汉。
PBT_APMRESUMESUSPEND 唤醒时
PBT_APMSUSPEND 待机时 unit Unit1;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs;
const
PBT_APMQUERYSUSPEND = 0;
PBT_APMRESUMECRITICAL = 6;
PBT_APMRESUMESUSPEND = 7;
type
TForm1 = class(TForm)
private
{ Private declarations }
procedure WMPowerBC(var msg: TMessage); message WM_PowerBroadCast;
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.dfm}{ TForm1 }procedure TForm1.WMPowerBC(var msg: TMessage);
begin
case msg.Wparam of
PBT_APMQUERYSUSPEND : msg.Result:=0;//待机
PBT_APMRESUMECRITICAL ,
PBT_APMRESUMESUSPEND : showmessage('resume');//唤醒
end;
end;
2、网上有exe图标提取的工具
消息正确获取图标参考http://www.bccn.net/Article/kfyy/delphi/jszl/200601/3104.html
1、使用timer来不断检测屏幕保护程序是否启动或者退出;
2、采用SystemParametersInfo来判断屏幕保护程序的状态,如下var
Status : bool;
begin
SystemParametersInfo(SPI_GETSCREENSAVEACTIVE, 0, @status, 0);
if Status = True then
ShowMessage('Screensaver has been enabled.')
else
ShowMessage('Screensaver has been disabled.');
end;