{************************************************************}
{ }
{ MpuTimerQueue }
{ }
{ Copyright (c) 2004 Michael Puff }
{ }
{ When I die I want 'Hello, world' carved on my headstone. }
{ }
{************************************************************}
unit MpuTimerQueue;
interface
uses
windows;
const
WT_EXECUTEDEFAULT = $00000000;
WT_EXECUTEINIOTHREAD = $00000001;
WT_EXECUTEINUITHREAD = $00000002;
WT_EXECUTEINWAITTHREAD = $00000004;
WT_EXECUTEONLYONCE = $00000008;
WT_EXECUTEINTIMERTHREAD = $00000020;
WT_EXECUTELONGFUNCTION = $00000010;
WT_EXECUTEINPERSISTENTIOTHREAD = $00000040;
WT_EXECUTEINPERSISTENTTHREAD = $00000080;
WT_TRANSFER_IMPERSONATION = $00000100;
type
WAITORTIMERCALLBACKFUNC =
procedure(P: Pointer; B: Boolean);
stdcall;
TWAITORTIMERCALLBACK = WAITORTIMERCALLBACKFUNC;
function CreateTimerQueue: THandle;
stdcall;
function CreateTimerQueueTimer(
var NewTimer: THandle; TimerQueue: THandle;
Callback: TWAITORTIMERCALLBACK; Parameter: Pointer; DueTime, Period: DWORD;
Flags: ULONG): LongBool;
stdcall;
function ChangeTimerQueueTimer(TimerQueue: THandle; Timer: THandle; DueTime:
ULONG; Period: ULONG): LongBool;
stdcall;
function DeleteTimerQueueTimer(TimerQueue, Timer, CompletionEvent: THandle):
LongBool;
stdcall;
function DeleteTimerQueueEx(TimerQueue: THandle; CompletionEvent: THandle):
LongBool;
implementation
function CreateTimerQueue;
external kernel32
name '
CreateTimerQueue';
function CreateTimerQueueTimer;
external kernel32
name '
CreateTimerQueueTimer';
function ChangeTimerQueueTimer;
external kernel32
name '
ChangeTimerQueueTimer';
function DeleteTimerQueueTimer;
external kernel32
name '
DeleteTimerQueueTimer';
function DeleteTimerQueueEx;
external kernel32
name '
DeleteTimerQueueEx';
end.