Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

GetThreadDesktop

Status
Not open for further replies.

agroothe

Programmer
Feb 26, 2004
3
0
0
GB
Hi,

Does anyone know how to implement GetThreadDesktop using C#? I need to use this to find the currently logged on user from a windows service.

The process is as follows:
GetThreadDesktop()
--> GetUserObjectInformation()
--> LookUpAccountName()

Any help would be appreciated.

Regards,
Andrew
 
Why not use something like this:

Code:
using System.Security.Principal;

string username = WindowsIdentity.GetCurrent().Name.ToString();
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top