 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
volker
Joined: 07 Mar 2005 Posts: 2
|
Posted: Mon Mar 07, 2005 11:00 am Post subject: detect a window by its task-id |
|
|
can anybody help?
i want to send a command to a window. the only infomation that i have is its task id. how can i attach this window?
thanks volker |
|
| Back to top |
|
 |
BoBo Guest
|
Posted: Mon Mar 07, 2005 11:11 am Post subject: |
|
|
Guess if you call/activate it using this process ID
WinGet [v1.0.12+]
--------------------------------------------------------------------------------
Retrieves a window's unique ID, process ID, process name, or a list of its controls. It can also retrieve a list of all windows matching the specified criteria.
Hast du dich schon im [Deutschen AHK Forum] angemeldet ?  |
|
| Back to top |
|
 |
Guest
|
Posted: Mon Mar 07, 2005 12:39 pm Post subject: |
|
|
sorry bobo,
what i do is the following:
first i start a program like:
Run, notepad.exe , , , PID
the program is running twice and i do not know the window-title
how can i send a command to the program using the PID?
volker
habe mich im deutschen forum angemeldet...
schön, dass ihr daran arbeitet.  |
|
| Back to top |
|
 |
BoBo Guest
|
Posted: Mon Mar 07, 2005 1:07 pm Post subject: |
|
|
WinGet [v1.0.12+]
--------------------------------------------------------------------------------
Retrieves a window's unique ID, process ID, process name, or a list of its controls. It can also retrieve a list of all windows matching the specified criteria.
WinGet, OutputVar [, Cmd, WinTitle, WinText, ExcludeTitle, ExcludeText]
List: Retrieves the unique ID numbers of all existing windows that match the specified WinTitle, WinText, ExcludeTitle, and ExcludeText (to retrieve all windows on the entire system, leave WinTitle and WinText blank but specify Program Manager or a non-existent title for ExcludeTitle). Each ID number is stored in an array element whose name begins with OutputVar's own name, while OutputVar itself is set to the number of retrieved items (0 if none). For example, if OutputVar is MyArray and two matching windows are discovered, MyArray1 will be set to the ID of the first window, MyArray2 will be set to the ID of the second window, and MyArray itself will be set to the number 2.
| Code: | SetTitleMatchMode, 2
WinGet, OutputVar, List, - Notepad
Loop, %OutputVar0% ; Anzahl Loops = Anzahl gefundene Notepad Fenster
{
ID := OutputVar%A_Index%
MsgBox, %A_Index%. NotepadID: %ID%
} |
Braindump. Untested.
Willkommen in der Deutschen AHK-Community  |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10467
|
Posted: Mon Mar 07, 2005 1:15 pm Post subject: |
|
|
| Anonymous wrote: | | how can i send a command to the program using the PID? |
A simpler method was added in v1.0.28. Here is an example:
WinActivate ahk_pid %PID% |
|
| Back to top |
|
 |
volker
Joined: 07 Mar 2005 Posts: 2
|
Posted: Thu Mar 10, 2005 9:00 pm Post subject: |
|
|
thanks.. it works... |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|