memerim Posted January 8, 2020 Share Posted January 8, 2020 (edited) I'm using a third party app to search for image on my screen, when image found it give me the pos XY relative to my screen. Is possible convert a XY position relative to screen to a XY pos of handle control? Example: Using au3 info the pos of the word "Autoit" is 542,307 (2) Searching the "Autoit" word relative to my screen is 677,384 (1) What im trying achieve is convert the pos (1) to pos (2) and use in the controlclick function: $X = pos converted from 677 to 542 ControlClick("", "", "", "left", 1, $X, $Y) I found this function to convert screen to client, but it convert only the window relative pos, to a control pos: https://www.autoitscript.com/autoit3/docs/libfunctions/_WinAPI_ScreenToClient.htm Using this function it will convert pos 542, 307 (found on au3 info window) to a controlclick pos (538,313) So i would like ask if there's any function to do the same above, but converting screen to control. Edited January 8, 2020 by memerim Link to comment Share on other sites More sharing options...
Nine Posted January 8, 2020 Share Posted January 8, 2020 WinPos will give the position of the window. By removing the X and Y position you will get the control position. Also take a look at Opt ("PixelCoordMode", 0), might work with your image search... “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...
memerim Posted January 8, 2020 Author Share Posted January 8, 2020 (edited) "I'm using a third party app to search for image on my screen" how pixelcoordmode could help? WinPos? And i cant remove the X and Y position from the control. Why au3 info gives wrong result as my screen is 1920x1080 it display 1535 822, look at windowspy from another program, 1920x1080 Theres a weird white small box with wrong size, when i try select my desktop screen: Spoiler Spoiler I've already tried change all options in coord mode, and it always display my screen as 1535 Edited January 8, 2020 by memerim Link to comment Share on other sites More sharing options...
memerim Posted January 8, 2020 Author Share Posted January 8, 2020 (edited) I found the problem, if someone suffer with same, to resolve it: Go to autoit folder and change DPI option in auto window info and autoit exe: Now my autoit info display correct position and size of things. ------------- -EDIT- Problem solved, as the autoit can click correct position now, i can use the function i post before and convert screen to client pos. Edited January 8, 2020 by memerim 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