C++ – How to get logged-in user’s full name in windows

cnetwinapiwindows

How to get logged-in user's full name (the one he/she entered as his/her real name) using windows API or something else? For example how to get "John Smith", not "john" (as it were his username).

GetUserName(…) doesn't do the job because it returns the username, not the full name.

Best Answer

Did you try GetUserNameEx(NameDisplay,...)?