Accessing Windows User Account

Posted on 2004-08-22
Last Modified: 2010-04-01
Hello Experts,

I am developing a program, Windows Xp/2000 based, that need to know the user account of the Windows. The program needs to verify that username and password match with the username and password entered in windows logon form appear for the first time.

1)How can i access the user account of the windows? Where is it can be found?
2)same as number 1) and do it programmatically?
3)Are there any resources that can help to do this?

Question by:wildan_ali
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
LVL 86

Expert Comment

ID: 11866747
See;en-us;q180548 ("How To Validate User Credentials on Microsoft Operating Systems"), the article comes with all necessary sample code.

Expert Comment

ID: 11891404
To get the currently logged-on user, you can use the GetUserName or GetUserNameEx API

Author Comment

ID: 11919541
antthony, is it can be implemented before the user logged on?
LVL 86

Accepted Solution

jkr earned 125 total points
ID: 11922345
If no user is logged on, you cannot get any usernames...

Author Comment

ID: 11924308
I want to get information bout windows user account before logged on. becouse i want to log on to windows by not using the log on form. Are there any way to do?

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

695 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question