Re: Win32Lib getUserName() problem
- Posted by mattlewis (admin) Dec 16, 2009
- 1651 views
AndyDrummond said...
Is there any way that anyone knows whereby I can get the current user's name, rather than the name the current account was created with?
I'm not sure what Win32Lib is doing, exactly, but you might want to take a look at GetUserNameEx. There appear to be many different ways to get a name:
typedef enum { NameUnknown = 0, NameFullyQualifiedDN = 1, NameSamCompatible = 2, NameDisplay = 3, NameUniqueId = 6, NameCanonical = 7, NameUserPrincipal = 8, NameCanonicalEx = 9, NameServicePrincipal = 10, NameDnsDomain = 12 } EXTENDED_NAME_FORMAT, *PEXTENDED_NAME_FORMAT;
Matt