🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Service HandlerEx: SERVICE_CONTROL_SESSIONCHANGE

#12343
From: Remy Lebeau (TeamB)
Date: Thu, 11 Dec 2003 18:58
29 lines
1927 bytes
"Andreas Schwarz" <andreas.schwarz@hamburg.de> wrote in message
news:3fd83dcd@newsgroups.borland.com...

> Next i want to get the username... how to do this ?

Use WTSQuerySessionInformation() with the WTSInfoClass parameter set to
WTSUserName.

> I know that this is only working on Windows XP Systems

Correct

> but how do i got notified when the user
> is changed on Windows 2000 ?

You don't, not via HandlerEx() anyway.  That capability was added in XP.
You will just have to use a separate window that intercepts the
WM_QUERYENDSESSION and WM_ENDSESSION messages to see when the user is
logging out. But you can't detect when the user is logging in that way.  You
would probably have to write a replacement GINA.DLL to hook into the
WinLogon screen itself.

Otherwise, the simpliest way to detect login and logout is to simply run a
loop that repeadedly gets the username of the currently active user, and
then check when that value changes.


Gambit
Technical Details
Message-ID: <3fd8bd44$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <3fd83dcd@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,9ad4c0e990b3fca5
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-12-11 11:09:51 PST
From: "Remy Lebeau \(TeamB\)" <gambit47.no.spam@no.spam.yahoo.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <3fd83dcd@newsgroups.borland.com>
Subject: Re: Service HandlerEx: SERVICE_CONTROL_SESSIONCHANGE
Date: Thu, 11 Dec 2003 10:58:26 -0800
Lines: 31
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: 67.23.78.224
Message-ID: <3fd8bd44$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1071168836 67.23.78.224 (11 Dec 2003 10:53:56 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail