Current windows user

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

      char acUser [ 255];
      ULONG ul;

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

Thanks again.
All Courses

From novice to tech pro — start learning today.