Sign in to follow this  
Followers 0
comeonyoureds

Identical windows

6 posts in this topic

Hello! I must first mention that I am very new to AutoIt. The problem is I am starting to write a script and I will be working with several identical windows:several instances of the same process.Looking through the reference, it is not clear on how I could differentiate the windows.Was thinking about using the PID to do that, but could not find a function to return main window handle by PID.

So, my question is: how can I differentiate several identical windows based on the PID they belong to?

Thank you!

Share this post


Link to post
Share on other sites



Use the AutoIt Window Info tool

Aye,that would be a non automatic solution.However, it seems that the help file already addresses this problem and the solution seems to be described under the 'Advanced Window Descriptions'.

Anyway, thanks for the fast response!

Share this post


Link to post
Share on other sites

You can use WinList with WinGetProcess, like many UDF functions do :P

ProcessGetWindows (better formatted code here)

or this: _ProcessGetWindow (returns only the first found Window)


*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Share this post


Link to post
Share on other sites

Maybe a bit too late but I just knocked this one up

#include <array.au3>

$aArray = _WinList()
_ArrayDisplay($aArray)

Func _WinList($vTitle = "", $vText= "")
    If $vTitle & $vText = "" then 
        $aWinTmp = WinList()
    Else
        $aWinTmp = WinList($vTitle,$vText )
    EndIf
    Local $aWinList[$aWinTmp[0][0] +1][3]
    $aWinList[0][0] = $aWinTmp[0][0]
    For $i = 1 To $aWinTmp[0][0] 
        $aWinList[$i][0] = $aWinTmp[$i][0]
        $aWinList[$i][1] = $aWinTmp[$i][1]
        $aWinList[$i][2] = WinGetProcess($aWinTmp[$i][1])
    Next

    Return $aWinList
EndFunc

Share this post


Link to post
Share on other sites

Hehe, thanks a lot guys for the additional input, will sure look into all of these! :P

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0