How to get logged-in user's full name in windows?

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


A quick Google reveals that NetUserGetInfo should do this. It doesn't look like the easiest API in the world to use.

I think the level you're after is 10, which returns a USER_INFO_10 structure, containing, among other things, a usri10_full_name.

Make sure you remember to free the structure when finished, using NetApiBufferFree!