delphi 中的delay函数
procedure Delay(msecs:integer);
var
Tick: DWord;
Event: THandle;
begin
Event := CreateEvent(nil, False, False, nil);
try
Tick := GetTickCount + DWord(msecs);
while (msecs > 0) and (MsgWaitForMultipleObjects(1, Event, False, msecs, QS_ALLINPUT) <> WAIT_TIMEOUT) do
begin
Application.ProcessMessages;
msecs := Tick - GetTickcount;
end;
finally
CloseHandle(Event);
end;
end;
相关文档:
前段时间因为项目需要,获取指定文件的图标,绕了很多弯子,现在弄出来了,跟大家共享下.
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls,ShellAPI, ExtCtrls;
type
TForm1 = class(TForm)
l ......
Delphi编写系统服务三:编写两栖系统服务 收藏
采用下面的方法,可以实现一个两栖系统服务(既系统服务和桌面程序的两种模式)
工程代码:
program FleetReportSvr;
uses
SvcMgr,
Forms,
SysUtils,
Windows,
SvrMain in 'SvrMain.pas' {FleetReportService: TService}, ......
Delphi编写系统服务二:系统服务和桌面程序的区别 收藏
Windows 2000/XP/2003等支持一种叫做“系统服务程序”的进程,系统服务和桌面程序的区别是:
系统服务不用登陆系统即可运行;
系统服务是运行在System Idle Process/System/smss/winlogon/services下的,而桌面程序是运行在Explorer下的;
......
delphi中Webbrowser的使用
1.获得网页中变量值
htm中<script> var currID=123</script>
程序中可以这么调用 id := Form1.WebBrowser1.OleObject.Document.script.currID
值得说明的是,变量可以是javascript定义的,也可以是vbs ......