forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


help, windows handling?

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
nickos
Valued Newbie


Joined: 17 Mar 2007
Posts: 26

PostPosted: Mon Apr 14, 2008 3:17 pm    Post subject: help, windows handling? Reply with quote

How to find windows handling from it's process name from Tasklist command?
Back to top
View user's profile Send private message Send e-mail
WidgetCoder
Contributor
Contributor


Joined: 28 May 2002
Posts: 126
Location: CO, USA

PostPosted: Mon Apr 14, 2008 6:21 pm    Post subject: Reply with quote

The problem with obtaining a window handle from a PID is that any process may have multiple windows associated with it. However there is an API function (GetWindowThreadProcessId) that will do the reverse (obtain a PID from a Hwnd) if you wanted to create a list of PIDs from winlist. I have used this function in the past although I'm not sure if it was in VDS or not I'll look for the code.
Back to top
View user's profile Send private message Send e-mail
WidgetCoder
Contributor
Contributor


Joined: 28 May 2002
Posts: 126
Location: CO, USA

PostPosted: Tue Apr 15, 2008 8:40 am    Post subject: Reply with quote

I found an example (attached), hope this helps...


WinProcDemo.zip
 Description:
GetWindowThreadProcessId example

Download
 Filename:  WinProcDemo.zip
 Filesize:  792 Bytes
 Downloaded:  1318 Time(s)

Back to top
View user's profile Send private message Send e-mail
nickos
Valued Newbie


Joined: 17 Mar 2007
Posts: 26

PostPosted: Tue Apr 22, 2008 2:22 pm    Post subject: Reply with quote

Thanks for the help Widget.

I have a lot of running programs with same title with different exe's.
By comparing process from winproc list with title, got it's parent process.

Btw, what is PID use for in VDS ?
Rolling Eyes
Back to top
View user's profile Send private message Send e-mail
WidgetCoder
Contributor
Contributor


Joined: 28 May 2002
Posts: 126
Location: CO, USA

PostPosted: Tue Apr 22, 2008 4:48 pm    Post subject: Reply with quote

The "PID" or Process Identifier (process handle) is a unique number that the operating system assigns to each running process. For example it could be used for VDS's KILLTASK command and is especially useful when there is more than one instance of the same program running. Each time a program is launched it's PID will change much like a Window Identifier or window handle (Hwnd). The OS manages these these list to ensure that no two PID's or Hwnd's are the same.

Happy coding...!
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group