Article View: borland.public.cppbuilder.nativeapi
Article #4729Re: Detect WinXP Login Screen
From: Remy Lebeau (TeamB)
Date: Wed, 14 Dec 2005 23:23
Date: Wed, 14 Dec 2005 23:23
28 lines
2234 bytes
2234 bytes
"Thom A." <thoma@gmx.at> wrote in message
news:43a099bd$1@newsgroups.borland.com...
> I use the following code to detect when a screen saver
> has been started, and when it was stopped:
That approach is dependant on the screen saver executable actually doing
what it is supposed to be doing - notifying the OS that the screen saver is
running. On NT-based systems, at least, a more reliable approach would be
to use OpenDesktop() to see if the "Screen-saver" desktop is actually
running. Do note, however, that there is a known bug in NT 4.0 SP4:
BUG: OpenDesktop ("screen-saver",...) Returns a Valid Handle When the
Screen Saver Is Not Running
http://support.microsoft.com/default.aspx?scid=kb;en-us;230117
> Now this tells me that a screen saver has been stopped, but it doesn't
> detect whether the Windows XP login screen, or the Login window is
> visible. Is there a way to detect this, either?
Use OpenDesktop() to open the "WinLogin" desktop. In case WinLogin
continues to exist while the user is working, you may have to use
OpenInputDesktop() instead and then use GetUserObjectInformation() to see if
the active desktop's name is "WinLogin".
Gambit
Technical Details
Message-ID:
<43a0a9ae$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!atl-c02.usenetserver.com!news.usenetserver.com!atl-c07.usenetserver.com!news.usenetserver.com!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mailReferences:
<43a099bd$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,eda9c56c5ddeb0a7 X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <43a099bd$1@newsgroups.borland.com> Subject: Re: Detect WinXP Login Screen Date: Wed, 14 Dec 2005 15:23:17 -0800 Lines: 30 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 NNTP-Posting-Host: 68.69.17.41 Message-ID: <43a0a9ae$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1134602670 68.69.17.41 (14 Dec 2005 15:24:30 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!atl-c02.usenetserver.com!news.usenetserver.com!atl-c07.usenetserver.com!news.usenetserver.com!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail