Ok, I get how to get the HWND & PID of the main window.
If I have multiple instances of an application window open, and open a dialog in each, How do I tie each dialog to it's correct process?
For instance, I have 2 instances of VLC open, and each has the Adjustments and Effects dialog open.
Again, this is just an example, but how do I make certain I control the dialog belonging to the correct HWND or PID? I'm trying to keep interactions to multiple instances from getting intertwined.
Thanks for your assistance!
Multiple Windows and dialogs....
Re: Multiple Windows and dialogs....
I think that a dialog should have its own HWND. Have you tried getting that with ControlGet, , Hwnd?
Re: Multiple Windows and dialogs....
I opened two instances of Notepad, and opened the Open prompt in each of them. You can work out which Open prompts are related to which Notepad main windows, because each pair will have the same PID (process ID).
Code: Select all
q:: ;list visible windows with process name 'notepad.exe'
DetectHiddenWindows, Off
WinGet, vWinList, List, ahk_exe notepad.exe
vOutput := ""
Loop, % vWinList
{
hWnd := vWinList%A_Index%
WinGetTitle, vWinTitle, % "ahk_id " hWnd
WinGetClass, vWinClass, % "ahk_id " hWnd
WinGet, vPID, PID, % "ahk_id " hWnd
;WinGet, vPName, ProcessName, % "ahk_id " hWnd
vOutput .= vPID " | " hWnd " | " vWinTitle " | " vWinClass "`r`n"
}
Clipboard := vOutput
MsgBox, % vOutput
return
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
Re: Multiple Windows and dialogs....
OMG! Thank You!
Sorry I haven't been able to respond.... Work, Holiday and such....
Just got back to my project, and this is just what I was looking for! Thank you!
Sorry I haven't been able to respond.... Work, Holiday and such....
Just got back to my project, and this is just what I was looking for! Thank you!
Who is online
Users browsing this forum: Bing [Bot], Google [Bot] and 157 guests