Does anyone know the code to get the current username of the Windows NT system. eg. if my username is s98132, how do I get that in my prog.
This is a discussion on getting username from Windows NT within the Windows Programming forums, part of the Platform Specific Boards category; Does anyone know the code to get the current username of the Windows NT system. eg. if my username is ...
Does anyone know the code to get the current username of the Windows NT system. eg. if my username is s98132, how do I get that in my prog.
CHAR name[256];
ULONG size = sizeof(name);
GetUserName(name,&size);
name will contain the current user name.
zen