Current windows user

How can I detect the current windows logged in user?
SadManAsked:
Who is Participating?
 
jkrConnect With a Mentor Commented:
Use 'GetUserName()', e.g.

      char acUser [ 255];
      ULONG ul;

      if      (      !GetUserName      (      acUser,      &ul))
            {
                  ERROR(      "GetUserName() failed!");
            }
0
 
SadManAuthor Commented:
Thanks, I just could not remember the command, and did not have the MSDN CD's with me at work.

Thanks again.
0
All Courses

From novice to tech pro — start learning today.