Sign in to follow this  
aftermath

[Win32] Getting user name (in John Smith form, not jsmith)

Recommended Posts

Like the title says, does anyone know what Win32 API functions I would use to get the current user name? I need it in formal format, like John Smith, as oposed to a user-id format like jsmith. Thanks

Share this post


Link to post
Share on other sites
Quote:
Original post by tHiSiSbOb
What do you mean exactly? You can simply use a windows edit box and use GetDlgItemText to read the entered text.


He probably meant the Windows Register.


OP: Try doing a Google search on the Windows Register, where it's contained. (Somewhere along CURRENT_USER?)

Share this post


Link to post
Share on other sites
Windows registry.

Call NetUserGetInfo() with a level of 2 after you get the current username with GetUserName().

Special thanks: google groups.

That's for NT. For 9x you'll need a completely different way I'm afraid, look around. GetUserNameEx() is 2k up and only I think.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this