🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #4643

Re: Detect WinXP Login Screen

#4643
From: Remy Lebeau (TeamB)
Date: Thu, 15 Dec 2005 18:50
28 lines
2171 bytes
"Thom A." <thoma@gmx.at> wrote in message
news:43a15537$1@newsgroups.borland.com...

> HWND hDesktop = OpenInputDesktop(0,false,DESKTOP_READOBJECTS);
>
> returns a valid handle if the desktop is visible or a screen-saver is
> running, but returns hDesktop = 0, when the login screen is shown.

Did you call GetLastError() to find out why?

Also, it is possible for OpenInputDesktop() to fail if the associated
workstation is in the process of shutting down while the user is logging
out.

Also, you did not specify what kind of application is running your code.  If
it is a non-interactive service, for example, then OpenInputDesktop() will
always fail by default since a non-interactive service is not run in the
same workstation as the one that runs the WinLogon desktop.  Only desktops
in the "WinSta0" desktop can receive input, so you would have to use
OpenWindowStation() and SetProcessWorkStation() to put your application into
the "WinSta0" workstation before you can do anything with input-enabled
desktops, such as "WinLogon".

What EXACTLY are you trying to accomplish by detecting the WinLogin screen?


Gambit
Technical Details
Message-ID: <43a1baa8$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx01.iad01.newshosting.com!newshosting.com!news-out.newsfeeds.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail
References: <43a099bd$1@newsgroups.borland.com> <43a0a9ae$1@newsgroups.borland.com> <43a15537$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> <43a0a9ae$1@newsgroups.borland.com> <43a15537$1@newsgroups.borland.com>
Subject: Re: Detect WinXP Login Screen
Date: Thu, 15 Dec 2005 10:50:18 -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: <43a1baa8$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1134672552 68.69.17.41 (15 Dec 2005 10:49:12 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx01.iad01.newshosting.com!newshosting.com!news-out.newsfeeds.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail