想作一类似屏幕保护的功能,自己编写的程序,在一定时间内,如无人操作鼠标与键盘,将自动锁定,需用密码解开,如何实现? 如题!用什么方法来实现,是否用一定时器统计一段时间内是否有鼠标与键盘事件,系统的鼠标与键盘事件如何获取? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 应该是使用hook 全局钩子吧.... 定义一个ROCK窗体。然后一个Timer在onTimer事件上面写Application.OnIdle:=showROck;showROck;过程为自己定义,show出rock窗体,show模式要是showmodal。 user32.dllGetLastInputInfohttp://blog.csdn.net/jinjazz/archive/2008/02/21/2110620.aspx Delphi的unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, ExtCtrls;type TForm1 = class(TForm) Timer1: TTimer; procedure Timer1Timer(Sender: TObject); private { Private declarations } public { Public declarations } end; function BlockInput(fFreezeInput : boolean):DWord; stdcall; external 'user32.DLL';var Form1: TForm1;implementation{$R *.dfm}procedure TForm1.Timer1Timer(Sender: TObject);var vLastInputInfo: TLastInputInfo;begin vLastInputInfo.cbSize := SizeOf(vLastInputInfo); GetLastInputInfo(vLastInputInfo); if GetTickCount - vLastInputInfo.dwTime > 3000 then begin timer1.Enabled:= false; BlockInput(True); showmessage('超过3秒,已锁定!'); end;end;end. 把界面上的控件disable掉么好了 dbgrid的问题,大家帮忙看看 怎么在stringgrid中输入汉字 如何分行显示dbgrid的列标题? ****紧急求救,关于事务的简单问题(二层的)**** 随机字符串的问题 打包问题 升级为五星,热烈祝贺,散分! web服务 编写自定义控件 专家分可以干什么 Service与SQL2000数据库使用,内存泄露 delphi上 用ADOQuery导入数据问题??
Application.OnIdle:=showROck;
showROck;过程为自己定义,show出rock窗体,show模式要是showmodal。
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls;type
TForm1 = class(TForm)
Timer1: TTimer;
procedure Timer1Timer(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end; function BlockInput(fFreezeInput : boolean):DWord; stdcall; external 'user32.DLL';var
Form1: TForm1;implementation{$R *.dfm}procedure TForm1.Timer1Timer(Sender: TObject);
var
vLastInputInfo: TLastInputInfo;
begin
vLastInputInfo.cbSize := SizeOf(vLastInputInfo);
GetLastInputInfo(vLastInputInfo);
if GetTickCount - vLastInputInfo.dwTime > 3000 then
begin
timer1.Enabled:= false;
BlockInput(True);
showmessage('超过3秒,已锁定!');
end;
end;end.