Hamster-Event-objects (Win32)

The hamster supports the "Event-object" " evtHamster. IsIdle ". It signals that no processes(lawsuits) are active in the hamster and the hamster unemployed (Idle) is.

One can use this object, e.g., for programs and Skripte, which articles and E-mails after the download nachbearbeiten.

Indication: connections with the local servers are not considered active order.

Examples of the practical use:

Perl:

Use Win32:: Event;

$evtHamsterIsIdle = Win32:: Event-> open (" evtHamster. IsIdle ");

* start hamster-tasks

$evtHamsterIsIdle-> wait ();

Visual Basic:

Private Const INFINITE = *HFFFF

Private Const SYNCHRONIZE = *H100000

Private Declare Function OpenEvent Lib "kernel32" Alias "OpenEventA" _

(ByVal dwDesiredAccess A Long, ByVal bInheritHandle A Long, _

ByVal lpName A String) A Long

Private Declare Function WaitForSingleObject Lib "kernel32" _

(ByVal hHandle A Long, ByVal dwMilliseconds A Long) A Long

Private Declare Function CloseHandle Lib "kernel32" _

(ByVal hObject A Long) A Long

Dim evtHamsterIsIdle A Long, res A Long

EvtHamsterIsIdle = OpenEvent (SYNCHRONIZE, False, " evtHamster. IsIdle ")

' Start hamster-tasks

Res = WaitForSingleObject (evtHamsterIsIdle, INFINITE)

Res = CloseHandle (evtHamsterIsIdle)

Delphi 3:

Uses Windows;

Var evtHamsterIsIdle: THandle;

EvtHamsterIsIdle: = OpenEvent (SYNCHRONIZE, False, ' evtHamster. IsIdle ');

// start hamster-tasks

WaitForSingleObject (evtHamsterIsIdle, INFINITE);

CloseHandle (hdlEvent);

Unable to open file