Sysinternals Homepage
Forum Home Forum Home > Windows Discussions > Development
  New Posts New Posts RSS Feed - PID of explorer.exe
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

PID of explorer.exe

 Post Reply Post Reply
Author
Message
alokb View Drop Down
Newbie
Newbie


Joined: 09 February 2009
Status: Offline
Points: 24
Post Options Post Options   Thanks (0) Thanks(0)   Quote alokb Quote  Post ReplyReply Direct Link To This Post Topic: PID of explorer.exe
    Posted: 03 April 2009 at 3:29pm
Hello All,

On XP and above, there can be multiple sessions.

I have a service program which is running on XP or above OS and in that i want to get the process id of explorer.exe.

I am using  WTSGetActiveConsoleSessionId to get the Active console session id.

Now i want to know, how do i get the PID of explorer.exe from the session id?

Thanks and Regards
Alok Bhatnagar.
Back to Top
molotov View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 04 October 2006
Status: Offline
Points: 17516
Post Options Post Options   Thanks (0) Thanks(0)   Quote molotov Quote  Post ReplyReply Direct Link To This Post Posted: 03 April 2009 at 3:33pm
Hi Alok,


ProcessIdToSessionId seems like it could be helpful here...
Daily affirmation:
net helpmsg 4006
Back to Top
alokb View Drop Down
Newbie
Newbie


Joined: 09 February 2009
Status: Offline
Points: 24
Post Options Post Options   Thanks (0) Thanks(0)   Quote alokb Quote  Post ReplyReply Direct Link To This Post Posted: 03 April 2009 at 4:24pm
Hello molotov,
 
It won't work since the the input param is process id in this function.
 
i want to get the process id of explorer from the session id.
 
Thanks
 
Alok BHatnagar.
 
Back to Top
molotov View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 04 October 2006
Status: Offline
Points: 17516
Post Options Post Options   Thanks (0) Thanks(0)   Quote molotov Quote  Post ReplyReply Direct Link To This Post Posted: 03 April 2009 at 6:02pm
You have the session ID.  Presumably, you can get the PIDs of running instances of explorer.exe... Then, call ProcessIdToSessionId with each PID, and note the PID that has the session ID you are interested in.
Daily affirmation:
net helpmsg 4006
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down