| View previous topic :: View next topic |
| Author |
Message |
nickos Valued Newbie

Joined: 17 Mar 2007 Posts: 26
|
Posted: Mon Apr 14, 2008 3:17 pm Post subject: help, windows handling? |
|
|
| How to find windows handling from it's process name from Tasklist command?
|
|
| Back to top |
|
 |
WidgetCoder Contributor


Joined: 28 May 2002 Posts: 126 Location: CO, USA
|
Posted: Mon Apr 14, 2008 6:21 pm Post subject: |
|
|
| 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 |
|
 |
WidgetCoder Contributor


Joined: 28 May 2002 Posts: 126 Location: CO, USA
|
Posted: Tue Apr 15, 2008 8:40 am Post subject: |
|
|
I found an example (attached), hope this helps...
| Description: |
| GetWindowThreadProcessId example |
|
 Download |
| Filename: |
WinProcDemo.zip |
| Filesize: |
792 Bytes |
| Downloaded: |
1319 Time(s) |
|
|
| Back to top |
|
 |
nickos Valued Newbie

Joined: 17 Mar 2007 Posts: 26
|
Posted: Tue Apr 22, 2008 2:22 pm Post subject: |
|
|
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 ?
|
|
| Back to top |
|
 |
WidgetCoder Contributor


Joined: 28 May 2002 Posts: 126 Location: CO, USA
|
Posted: Tue Apr 22, 2008 4:48 pm Post subject: |
|
|
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 |
|
 |
|