WBHIIHPP Posted January 18, 2024 Posted January 18, 2024 I have a project that opens an application and then opens windows magnifier and zooms in on a certain area of the application. After the zoom is finished I would like to minimize the Magnifier tool but, I am unable to make that happen. I have tried using mousemove and mouse click to click the minimize button and I have tried the following: ;Opens the Windows Magnifier Send("#=") ;Wait 200 msec Sleep(200) ;Minimize tbe Mangnifier Tool WinSetState("Magnifier","",@SW_HIDE) Any ideas on why these approaches will not work?
OJBakker Posted January 18, 2024 Posted January 18, 2024 Check the returnvalue of winsetstate. If the focus is still on the magnifier you can minimize the window with WinKey - Down arrow, in code: Send("#{DOWN}")
Solution Andreik Posted January 18, 2024 Solution Posted January 18, 2024 (edited) #include <SendMessage.au3> Local $WM_SYSCOMMAND = 0x0112 Local $SC_MINIMIZE = 0xF020 Send('#=') WinWait('Magnifier') Sleep(2000) _SendMessage(WinGetHandle('Magnifier'), $WM_SYSCOMMAND, $SC_MINIMIZE, 0) Edited January 18, 2024 by Andreik Xandy 1
Werty Posted January 22, 2024 Posted January 22, 2024 (edited) As an alternative to windows magnifier you can use autoIt itself, the windows magnifier is not very good, very slow responding, whereas an AutoIt version is much faster, check it out... #include <WinAPI.au3> HotKeySet("{ESC}", "_exit") $Gui = GUICreate("Magnifier", 512, 512, -1, -1) GUISetState() Global $DesktopDC = _WinAPI_GetDC(0) Global $GuiDC = _WinAPI_GetDC($Gui) ;------------------------------------------------------------------------------ WHILE 1 _WinAPI_StretchBlt($GuiDC, 0, 0, 512, 512, $DesktopDC, MouseGetPos()[0]-64, MouseGetPos()[1]-64, 128, 128, 0x00CC0020) Sleep(10) WEND ;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------ Func _exit() Exit EndFunc ;------------------------------------------------------------------------------ You can even hold the mouse over a playing movie and it updates instantly, windows magnifier cant do that. Edited January 22, 2024 by Werty Some guy's script + some other guy's script = my script!
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