RE: Detecting locked screen
"Steve Lacey" <[email protected]> Wed, 22 Sep 2004 11:48:11 -0700
| Newsgroups | gmane.games.devel.windows |
|---|---|
| Message-ID | <3482FD65D9434246BB993A13EE091D4E0542DBFD@RED-MSG-30.redmond.corp.microsoft.com> |
You can check if it has happened:
bool CheckForDesktopAvailable(void)
{
bool bAvailable = false;
// Check to see if the desktop is locked
HDESK hDesk = OpenDesktop("Default", 0, FALSE,
DESKTOP_SWITCHDESKTOP);
if (hDesk)
{
if (SwitchDesktop(hDesk) != 0)
{
bAvailable = true;
}
CloseDesktop(hDesk);
}
return (bAvailable);
}
AFAIK there is no message to tell you when it happens...
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of
Brian Hook
Sent: Wednesday, September 22, 2004 11:33 AM
To: [email protected]
Subject: [GD-Windows] Detecting locked screen
I'm trying to detect when the user has chosen to lock their workstation
(via Task Manager or an app that calls LockWorkStation() directly), and
I can't seem to find a simple way of doing this.
I don't need to do anything, I just need to know if it's occurred or
not. I was hoping there was some WM_LOCKWORKSTATION or something
equivalent, but the nearest I can find is WM_ENDSESSION which isn't
quite what I'm looking for. There is no WM_SYSCOMMAND type that is
appropriate as well.
Most stuff I see recommend installing a GINA DLL, but that may not be
possible since the workstation user might have limited rights.
If it's something as cheezy as doing a FindWindow for the Logon screen,
that would work too, but I'm not sure what that window is called or if
it's present all the time and just invisible unless locked, etc.
Any pointers appreciated.
Thanks,
Brian
-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
_______________________________________________
Gamedevlists-windows mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows
Archives:
http://sourceforge.net/mailarchive/forum.php?forum_idU5
-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
_______________________________________________
Gamedevlists-windows mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows
Archives:
http://sourceforge.net/mailarchive/forum.php?forum_idU5