Ci dovrebbe essere la funzione GetUserName(... di Platform SDK.
Vedi nelle MSDN online alla voce System Information Function.