1. Can this be done reliably? Some Usenet posters suggest it is either not
possible or not reliable.
There is a COM interface ISensLogon::StopScreenSaver but that seems tied up
with mobile computing and hardware, ONNow, ACPI etc.
2. If so how?
3. The following snippet of C code from MS support
http://support.microsoft.com/support/kb/articles/q140/7/23.asp
offers a method which when translated to Delphi syntax produces a Handle
but does not close the screen saver window. Anyone able to improve on this?
This is obviously difficult to debug!, (in this case the screensaver should
be torn down
on receipt of a UDP broadcast).
" BOOL CALLBACK KillScreenSaverFunc(HWND hwnd, LPARAM lParam)
{
if(IsWindowVisible(hwnd))
PostMessage(hwnd, WM_CLOSE, 0, 0); return TRUE; }
HDESK hdesk;
hdesk = OpenDesktop(TEXT("Screen-saver"),
0,
FALSE,
DESKTOP_READOBJECTS |
DESKTOP_WRITEOBJECTS);
if (hdesk) {
EnumDesktopWindows(hdesk, KillScreenSaverFunc, 0);
CloseDesktop(hdesk); }
"
Cheers,
Steve Cooney
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz