Doesn't a Process have a user?
-
I am writing a C# app which accesses the list of processes using Process.GetProcesses(). However I was very puzzled when I studied the Process class to discover that it has no method or property pertaining to the user that is running the process. Surely, under XP at least, all processes must have an associated user. Certainly Task Manager lists the user with each processes. Can anyone tell me how, having got the Process object, I then find out which user it is running under? Dave
-
I am writing a C# app which accesses the list of processes using Process.GetProcesses(). However I was very puzzled when I studied the Process class to discover that it has no method or property pertaining to the user that is running the process. Surely, under XP at least, all processes must have an associated user. Certainly Task Manager lists the user with each processes. Can anyone tell me how, having got the Process object, I then find out which user it is running under? Dave
If you know the Win32 API function to retrieve that information, you can always P/Invoke it and pass theHandle[^] property as the HANDLE parameter. Regards Senthil _____________________________ My Blog | My Articles | WinMacro
-
If you know the Win32 API function to retrieve that information, you can always P/Invoke it and pass theHandle[^] property as the HANDLE parameter. Regards Senthil _____________________________ My Blog | My Articles | WinMacro
Well, if that's the only way . . . Actually I don't know the API call either - anybody help? Dave