MysteriousMan Posted March 3, 2020 Share Posted March 3, 2020 So i am trying to make it when i press my hotkey it opens up my application it goes through the startup menu. But my coordinates are right but the color detection seems to be off when i hover my cursor above what should be 0x2E4E6E it comes up as the color way below it (0xFFFFFF) Any way to maybe re-center it or something? Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted March 3, 2020 Moderators Share Posted March 3, 2020 Why would you not just set it up to launch the application's executable on your hotkey press? Why bother trying to mimic the mouseclick at all? "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
MysteriousMan Posted March 3, 2020 Author Share Posted March 3, 2020 when you start it up you have to click through a short menu and I would like to automate it Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted March 3, 2020 Moderators Share Posted March 3, 2020 Ok, so you're saying when the app launches there is a menu, your initial post made it sound like you wanted to click on the app from the system Start Menu. Since you are already using the AutoIt Window Info Tool, why are you going with the mouse clicks instead of using ControlClick or ControlSend on the element? Is it not returning info? "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
MysteriousMan Posted March 3, 2020 Author Share Posted March 3, 2020 i just want to know how to reset the windows info thing cause the colors is off of the coordinates Link to comment Share on other sites More sharing options...
Malkey Posted March 5, 2020 Share Posted March 5, 2020 (edited) On my laptop (OS:WIN_10 Running:(3.3.14.5)), under the system's 'Display Settings' (Right mouse click on desktop), the 'Scale and Layout' has the size as 125% (Recommended). And the 'Display Resolution' is 1920 x 1080 (Recommended). The actual desktop as returned from @DesktopWidth and @DesktopHeight is 1536 x 864 because of the 125% scale. I have noticed that if the 'Scale and Layout' value is other than 100%, then the $iScale variable will need to be added to a script so that the screen coordinates and the pixel coordinates will match - as per following example. What I wasn't aware of is that the Autoit AU3Info tool is also influenced by the 'Display Settings' > 'Scale and Layout' value being other than 100%. By changing the 'Scale and Layout' value to 100%, the color in the Autoit AU3Info tool will work correctly. expandcollapse popup#include <WinAPI.au3> #include <WinAPIGdi.au3> ; https://www.autoitscript.com/forum/topic/114695-how-do-i-use-pixel-search/?do=findComment&comment=802164 Opt("MouseCoordMode", 1) ;1=absolute, 0=relative, 2=client Global $iScale = _WinAPI_EnumDisplaySettings('\\.\DISPLAY1', $ENUM_CURRENT_SETTINGS)[0] / @DesktopWidth ; PhysicalScreenWidth / LogicalScreenWidth HotKeySet("{ESC}", "Terminate") Local $exit = 1 While $exit Sleep(10) TtColXY() WEnd ; TtColXY() Tooltip shows colour, and cursor position relative to screen and window. Func TtColXY() $aPos = MouseGetPos() Local $tPosS = _WinAPI_GetMousePos() ; similar to MouseGetPos() ;Screen mouse position $hHwnd = _WinAPI_WindowFromPoint($tPosS) Local $tPosC = _WinAPI_GetMousePos(True, $hHwnd) $sColor = "0x" & Hex(PixelGetColor(DllStructGetData($tPosS, "X") * $iScale, DllStructGetData($tPosS, "Y") * $iScale), 6) ConsoleWrite(StringRegExpReplace($sColor, "(..)(..)(..)(..)", "\2") & @LF) ConsoleWrite(Dec(StringRegExpReplace($sColor, "(..)(..)(..)(..)", "\2")) & @LF) $iPosX = ($aPos[0] - 130) * ($aPos[0] > @DesktopWidth * 0.90) + ($aPos[0] <= @DesktopWidth * 0.90) * ($aPos[0] + 3) $iPosY = ($aPos[1] - 70) * ($aPos[1] > @DesktopHeight * 0.96) + ($aPos[1] <= @DesktopHeight * 0.96) * ($aPos[1] + 3) ToolTip("Color is: " & $sColor & @CRLF & "R:" & Dec(StringRegExpReplace($sColor, "(..)(..)(..)(..)", "\2")) & _ " G:" & Dec(StringRegExpReplace($sColor, "(..)(..)(..)(..)", "\3")) & _ " B:" & Dec(StringRegExpReplace($sColor, "(..)(..)(..)(..)", "\4")) & @CRLF & _ "Screen: X: " & DllStructGetData($tPosS, "X") & " Y: " & DllStructGetData($tPosS, "Y") & @CRLF _ & "Client: X: " & DllStructGetData($tPosC, "X") & " Y: " & DllStructGetData($tPosC, "Y"), $iPosX, $iPosY) Return EndFunc ;==>TtColXY Func Terminate() $exit = 0 EndFunc ;==>Terminate Edited March 5, 2020 by Malkey 'Display Settings' (Right mouse click on desktop) - NOT "Left mouse click" 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