Jump to content

Identical windows


Recommended Posts

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!

Link to comment
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

Link to comment
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
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...