Domino Posted March 17, 2021 Share Posted March 17, 2021 ControlGetPos gives erroneous window size (height). I use ISN AutoIT Studio V1.11, on Windows 10Home 64-bit The code which, in my case, concentrates the problem is very simple: $aPos = ControlGetPos ($process_hWnd, "", "[CLASS:WindowsForms10.Window.8.app.0.141b42a_r7_ad1;INSTANCE:7]") _DebugOut("Control 7 [" & $aPos[0] & "," & $aPos[1] & "] " & $aPos[2] & "*" & $aPos[3]) c($process_hWnd, "", "[CLASS:WindowsForms10.Window.8.app.0.141b42a_r7_ad1;INSTANCE:7]") ; Required, unknown why $aPos = ControlGetPos ($process_hWnd, "", "[CLASS:WindowsForms10.Window.8.app.0.141b42a_r7_ad1;INSTANCE:7]") _DebugOut("Control 7 [" & $aPos[0] & "," & $aPos[1] & "] " & $aPos[2] & "*" & $aPos[3]) One should bet that the two resulting output lines are the same. Wrong. This is what I get: Control 7 [2,83] 1120*1561 Control 7 [2,83] 1126*1566 Clearly, for an unknown reason the ControlGetText statement in between influences (for me in the right way) the output of ControlGetPos. The result of the first ControlGetPos call is wrong, the result of the second call is right. I came to this because the output of the (first) call was wrong. Then I found some code enumerating control windows and their characteristics, where the result was right for that specific control. Hence I investigated which statement would interfere somehow, an it boiled down strangely to ControlGetText which altered the result of ControlGetPos. Unfortunately I cannot investigate further to find the root cause. WHAT IS WRONG ? The call itself or its use? Link to comment Share on other sites More sharing options...
Developers Jos Posted March 17, 2021 Developers Share Posted March 17, 2021 Moved to the appropriate forum. Moderation Team 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...
Nine Posted March 17, 2021 Share Posted March 17, 2021 Since nobody can run your script, I expect nobody will help you solve your issue. I suggest you create your own GUI and try to replicate the issue. If you still find the same behavior, then provide the complete runable code, so we can test on our side if we do have the problem. ps. when posting code please use this tool. “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
argumentum Posted March 17, 2021 Share Posted March 17, 2021 maybe Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting. Link to comment Share on other sites More sharing options...
Domino Posted March 18, 2021 Author Share Posted March 18, 2021 Isn't there a kind of source code ControlGetPos, so I could bypass the original one on that place and investigate a little further down? Il'' try to make it reproducible, but in the mean time the code was; $aPos = ControlGetPos ($process_hWnd, "", "[CLASS:WindowsForms10.Window.8.app.0.141b42a_r7_ad1;INSTANCE:7]") _DebugOut("Control 7 [" & $aPos[0] & "," & $aPos[1] & "] " & $aPos[2] & "*" & $aPos[3]) ControlGetText($process_hWnd, "", "[CLASS:WindowsForms10.Window.8.app.0.141b42a_r7_ad1;INSTANCE:7]") ; Required, unknown why $aPos = ControlGetPos ($process_hWnd, "", "[CLASS:WindowsForms10.Window.8.app.0.141b42a_r7_ad1;INSTANCE:7]") _DebugOut("Control 7 [" & $aPos[0] & "," & $aPos[1] & "] " & $aPos[2] & "*" & $aPos[3]) The managed application window on which this code is applied is from the PDFEraser tool. 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