delphi简单判断程序30秒没有键盘和鼠标动作示例_PHP教程

WBOY
Release: 2016-07-20 11:16:52
Original
1015 people have browsed it

本文为大家详细介绍下delphi判断程序30秒没有键盘和鼠标动作,这里给timer设置了1000ms)的参数,表示30秒的间隔,具体实现如下,感兴趣的朋友可以参考下哈

以下为原代码:
(这里给timer设置了1000ms)的参数,表示30秒的间隔!!

复制代码代码如下:


unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls;
type
TForm1 = class(TForm)
Memo1: TMemo;
Button1: TButton;
Timer1: TTimer;
procedure Timer1Timer(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
procedure AppMessageHandler(var Msg:TMsg;var Handled:Boolean);
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
{ TForm1 }
procedure TForm1.AppMessageHandler(var Msg: TMsg; var Handled: Boolean);
begin
if (msg.message=WM_MOUSEMOVE) or (msg.message=WM_KEYDOWN) then timer1.tag:=0;
end;
procedure TForm1.Timer1Timer(Sender: TObject);
begin
timer1.tag:=timer1.tag+1;
if Timer1.tag=30 then close;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
close;
end;
end.

www.bkjia.com true http://www.bkjia.com/PHPjc/372260.html TechArticle 本文为大家详细介绍下delphi判断程序30秒没有键盘和鼠标动作,这里给timer设置了1000ms)的参数,表示30秒的间隔,具体实现如下,感兴趣的朋友...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!