Here's an example of how to do it in Delphi. The code
should help you see the steps you need to take to do
the PInvoke calls in C#.
http://tinyurl.com/k1ki [Experts-Exchange.com]
First, you have to get the Process ID somehow.
EnumProcesses in Psapi.dll will return you an array of
Process ID's.
You can then call OpenProcess from Kernel32.dll and
pass in a parameter that tells Win32 you're going to
inspect the Process's user token.
Then you can call OpenProcessToken() to get the process
security token.
From there, you can call GetTokenInformation() to
get the SID owner of the token.
Finally, you can call LookupAccountSid() to get the
name of the user with that SID.
If you need help getting started, let us know, becase
it's too lengthy of a process to post here in one
post.
-c
"Strahimir Antoljak" <st***@netzero.net> wrote in message
news:eM**************@TK2MSFTNGP12.phx.gbl...
another process
--
Strah
"Chad Myers" <cm****@N0.SP.4M.austin.rr.com> wrote in message
news:LW*********************@twister.austin.rr.com ...
"Strahimir Antoljak" <st***@netzero.net> wrote in message
news:O7**************@TK2MSFTNGP12.phx.gbl...
Is there a way to find out the name
of the user who created a process.
Some kind of process property or method
that would report the user name how launched
it?
(but not Environment.UserName)
Are you talking about the current process, or
another process?
-c