prdfy Posted May 5, 2010 Share Posted May 5, 2010 I am having a problem with the correct syntax to use the "Advanced Window Descriptions" for the WinExists and WinActive functions. I need to automate a window by matching its width and height. The help file says the following, but I can't get it to work. X \ Y \ W \ H - The position and size of a window Here is what I have so far just in test. I just using a message box for now so I can verify if it will hit on the correct box. I have to use width and height because it is a Citrix client and that is the only info the Autoit Info tool can see. ------------- While 1 Sleep(100) WEnd If WinActive("[[W:535;H:136]") then MsgBox(1,"","it worked") EndIf ----------- So what is the correct syntax for specifying the width and height when using WinActive or WinExists? Thanks Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted May 5, 2010 Moderators Share Posted May 5, 2010 prdfy,A couple of problems with that code:- 1. You will never get to the WinActive line because you never leave the While...WEnd loop. - 2. You have an extraneous [ in the WinActive syntax.Try this: While 1 If WinActive("[W:535;H:136]") Then MsgBox(1,"","it worked") ExitLoop EndIf Sleep(10) WEndM23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
logmein Posted May 5, 2010 Share Posted May 5, 2010 (edited) You can also use WinGetPos to retrieves the position and size of a given windowWhile 1 Sleep (100) $getsize = WinGetPos ('[Active]') If $getsize[2] = 535 And $getsize[3] = 136 Then MsgBox(1,"","it worked") ExitLoop EndIf WEndNote : you must put your fuctions in a loop for it to work! Edited May 5, 2010 by logmein [font=arial, helvetica, sans-serif][s]Total USB Security 3.0 Beta[/s] | [s]Malware Kill[/s] | Malware Scanner | Screen Hider | Locker | Matrix Generator[s]AUTO-SYNC 1.0 | MD5 Hash Generator | URL Checker | Tube Take [/s]| Random Text[/font] Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted May 5, 2010 Moderators Share Posted May 5, 2010 logmein, No, WinExists and WinActive is only use for windows title and text, not for width and heightWRONG. Please do not post inaccurate information. Go and look in the Help file under <Using AutoIt - Window Titles and Text (Advanced)> and scroll down to where it says: Advanced Window Descriptions A special description can be used as the window title parameter. This description can be used to identify a window by the following properties: [...] X \ Y \ W \ H - The position and size of a window If I posted the code it is because it works. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
prdfy Posted May 5, 2010 Author Share Posted May 5, 2010 Thanks Melba23, That worked. Cheers, Prdfy Link to comment Share on other sites More sharing options...
logmein Posted May 5, 2010 Share Posted May 5, 2010 Sorry! That is my mistake! Fixed! [font=arial, helvetica, sans-serif][s]Total USB Security 3.0 Beta[/s] | [s]Malware Kill[/s] | Malware Scanner | Screen Hider | Locker | Matrix Generator[s]AUTO-SYNC 1.0 | MD5 Hash Generator | URL Checker | Tube Take [/s]| Random Text[/font] Link to comment Share on other sites More sharing options...
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