title: How to get the domain of currently logged on user in Windows?
body: <p>I know I can get the currently logged on user name by calling <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms724432(v=vs.85).aspx" rel="nofollow">GetUserName</a>. I'm looking for an API function that returns the domain of this user.</p>