comeonyoureds Posted October 28, 2008 Posted October 28, 2008 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!
Bert Posted October 28, 2008 Posted October 28, 2008 Use the AutoIt Window Info tool The Vollatran project My blog: http://www.vollysinterestingshit.com/
comeonyoureds Posted October 28, 2008 Author Posted October 28, 2008 Use the AutoIt Window Info toolAye,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!
ProgAndy Posted October 28, 2008 Posted October 28, 2008 You can use WinList with WinGetProcess, like many UDF functions do 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
ChrisL Posted October 28, 2008 Posted October 28, 2008 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 [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire
comeonyoureds Posted October 28, 2008 Author Posted October 28, 2008 Hehe, thanks a lot guys for the additional input, will sure look into all of these!
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now