flat assembler
Message board for the users of flat assembler.

Index > Windows > Is user Logged On winapi ???

Author
Thread Post new topic Reply to topic
Spidark



Joined: 11 May 2005
Posts: 39
Spidark 06 Jan 2006, 01:48
Hallo there.
Happy new year 2 all.
Anybody know the winapi function wich i can use to check if a user is logged on a XP system ??
Can't find any on google..
Any help is welcome..

_________________
Spidark
Post 06 Jan 2006, 01:48
View user's profile Send private message Reply with quote
RedGhost



Joined: 18 May 2005
Posts: 443
Location: BC, Canada
RedGhost 06 Jan 2006, 13:53
Spidark wrote:
Hallo there.
Happy new year 2 all.
Anybody know the winapi function wich i can use to check if a user is logged on a XP system ??
Can't find any on google..
Any help is welcome..


i think the fact your code is executing shows they are logged on, and to see who is logged on you can use GetComputerName or GetComputerNameEx (better)

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/getcomputernameex.asp

_________________
redghost.ca
Post 06 Jan 2006, 13:53
View user's profile Send private message AIM Address MSN Messenger Reply with quote
Reverend



Joined: 24 Aug 2004
Posts: 408
Location: Poland
Reverend 06 Jan 2006, 23:09
GetSystemMetrics with apriopriate value:
SM_MEDIACENTER - Windows XP Media Center Edition
SM_STARTER - Windows XP Starter Edition
SM_TABLETPC - Windows XP Tablet PC Edition
SM_SERVERR2 - Windows Server 2003 R2
Post 06 Jan 2006, 23:09
View user's profile Send private message Visit poster's website Reply with quote
Spidark



Joined: 11 May 2005
Posts: 39
Spidark 07 Jan 2006, 00:16
Reverend wrote:
GetSystemMetrics with apriopriate value:
SM_MEDIACENTER - Windows XP Media Center Edition
SM_STARTER - Windows XP Starter Edition
SM_TABLETPC - Windows XP Tablet PC Edition
SM_SERVERR2 - Windows Server 2003 R2

Thanks i wil check this INFO later, but think i got a api that does the Job.
GetUserName
Quote:
The GetUserName function retrieves the user name of the current thread. This is the name of the user currently logged onto the system.

BOOL GetUserName(

LPTSTR lpBuffer, // address of name buffer
LPDWORD nSize // address of size of name buffer
);

You see what i,m trying to do is check to see if the user is logged on.
Once i got that info, check to see if user has pass his /her curvue. Wink
And Log him/her off.
I'm gonna try to put it together.
thanks Reverend, and RedGhost for the answers Wink

_________________
Spidark
Post 07 Jan 2006, 00:16
View user's profile Send private message Reply with quote
FrozenKnight



Joined: 24 Jun 2005
Posts: 128
FrozenKnight 07 Jan 2006, 13:31
Just so you know You can run a thread as a diffrent user even as the 'System' so GetUserName may return incorrectly in some cases.
Post 07 Jan 2006, 13:31
View user's profile Send private message Reply with quote
Spidark



Joined: 11 May 2005
Posts: 39
Spidark 09 Jan 2006, 08:19
FrozenKnight wrote:
Just so you know You can run a thread as a diffrent user even as the 'System' so GetUserName may return incorrectly in some cases.
Hmmm thanks for that little info,so the only whay to have total control is to create my own service.

_________________
Spidark
Post 09 Jan 2006, 08:19
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.