sgrobins
asked on
Getting username on WinNT / Win95
I have a program and need to get the current user that is logged in on the WinNT or Win95 machine. I am using ILOG as the API. Is there an easy way to get the user information. I tried using the USER_INFO_10 struct, but was unsuccessful. If this is the method of choice, can someone give a quick example on how to use the struct properly.
Thanks,
Shawn
Thanks,
Shawn
There is an SDK Function GetUserName(LPCTSTR StringPointer, DWORD* LengthofAllocatedString) which will return user name in StringPointer.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
GetUserName worked perfectly. Not sure how I overlooked that one, but Thanks.
USER_INFO_10 structure is typically used with NetUserEnum API which enumerates all user accounts on a server.
Exactly what information do you need about the current user ?