chmod777 Posted August 15, 2008 Share Posted August 15, 2008 Hi, can you run this script and tell me what messages you get: expandcollapse popup#cs ---------------------------------------------------------------------------- AutoIt Version: 3.2.12.1 Author: chmod777 Script Function: testing purposes #ce ---------------------------------------------------------------------------- Run ("notepad") $size = WinGetPos ( "[CLASS:Notepad]") If Not @error Then ; test property X If WinExists ("[CLASS:Notepad; X:" & $size[0] & "]") Then MsgBox (0,"X DETECTED", "Window with CLASS:Notepad and parametr >X< is open.") Else MsgBox (0,"X NOT DETECTED", "No such a window was detected.") EndIf ; test property Y If WinExists ("[CLASS:Notepad; Y:" & $size[1] & "]") Then MsgBox (0,"Y DETECTED", "Window with CLASS:Notepad and parametr >Y< is open.") Else MsgBox (0,"Y NOT DETECTED", "No such a window was detected.") EndIf ; test property W If WinExists ("[CLASS:Notepad; W:" & $size[2] & "]") Then MsgBox (0,"W DETECTED", "Window with CLASS:Notepad and parametr >W< is open.") Else MsgBox (0,"W NOT DETECTED", "No such a window was detected.") EndIf ; test property H If WinExists ("[CLASS:Notepad; H:" & $size[3] & "]") Then MsgBox (0,"H DETECTED", "Window with CLASS:Notepad and parametr >H< is open.") Else MsgBox (0,"H NOT DETECTED", "No such a window was detected.") EndIf EndIf The output should be X Detected Y Detected W Detected H Detected but I'm constantly getting X Detected Y Detected W Detected H NOT Detected. I don't know why the only H property doesn't function on my system. Is there a bug in the function or do I do something wrong? Thanx. Link to comment Share on other sites More sharing options...
youknowwho4eva Posted August 15, 2008 Share Posted August 15, 2008 I tried #include <GUIConstantsEx.au3> Run ("notepad") winwaitactive("Untitled") $size = WinGetPos ( "[CLASS:Notepad]") MsgBox(0, "Dimensions", $size[0] & @LF & $size[1] & @LF & $size[2] & @LF & $size[3] & @LF) and got 166, 97, 768, and 530 so it's there but your code does bring up the H not found, but then again I'm not familar with calling the Height from the class, maybe it rounds up where the other rounds down. I also just tried adjusting the window size and no dice. Giggity Link to comment Share on other sites More sharing options...
SaphuA Posted August 15, 2008 Share Posted August 15, 2008 I don't think it's a rounding error, check out the code below I have the same bug aswell, strange stuff. AutoItSetOption("WinTitleMatchMode", 4) Run ("notepad") WinWaitActive("[CLASS:Notepad]") $size = WinGetPos("[CLASS:Notepad]") If Not @error Then If WinExists("[CLASS:Notepad; X:" & $size[0] & "]") Then MsgBox (0,"X DETECTED", "Window with CLASS:Notepad and parametr >X< is open.") EndIf If WinExists("[CLASS:Notepad; Y:" & $size[1] & "]") Then MsgBox (0,"Y DETECTED", "Window with CLASS:Notepad and parametr >Y< is open.") EndIf If WinExists("[CLASS:Notepad; W:" & $size[2] & "]") Then MsgBox (0,"W DETECTED", "Window with CLASS:Notepad and parametr >W< is open.") EndIf If WinExists("[CLASS:Notepad; H:" & $size[3] & "]") Then MsgBox(0,"H DETECTED", "Window with CLASS:Notepad and parametr >H< is open.") Else For $i = -10000 To 10000 $offset = $size[3] + $i If WinExists("[CLASS:Notepad; H:" & $offset & "]") Then MsgBox(0, "H DETECTED", "$size[3]=" & $size[3] & "+ $i=" & $i & "=" & $offset) EndIf next EndIf EndIf http://www.saphua.com/ Link to comment Share on other sites More sharing options...
Developers Jos Posted August 15, 2008 Developers Share Posted August 15, 2008 Its a Bug in Autoit3. I will commit a fix for this. Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. 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