Ontosy Posted February 22, 2016 Share Posted February 22, 2016 When i launch "C:\Windows\System32\Magnify.exe" it fit in the top side of screen and resize the screen to the bottom (try it if I did not explain myself well). Do it is possible to do it with autoit3? Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 22, 2016 Moderators Share Posted February 22, 2016 Ontosy, I wrote this ages ago - it should give you some ideas: expandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <WinAPI.au3> #include <Misc.au3> Opt("GUICloseOnESC", 0) HotKeySet("{ESC}", "On_Exit") Global $hMag_GUI, $hMagDC, $hDeskDC, $hPen, $oObj, $aMouse_Pos[2], $iLast_Mouse_X = 0, $iLast_Mouse_Y = 0 ; Create GUI $hMag_Win = GUICreate("MAG", 100, 100, 0, 0, $WS_POPUP) GUISetState(@SW_SHOW, $hMag_Win) $hMag_GUI = WinGetHandle("MAG") ; Get device context for Mag GUI $hMagDC = _WinAPI_GetDC($hMag_GUI) If @error Then Exit ; Get device context for desktop $hDeskDC = _WinAPI_GetDC(0) If @error Then _WinAPI_ReleaseDC($hMag_GUI, $hMagDC) Exit EndIf ; Create pen $hPen = _WinAPI_CreatePen($PS_SOLID, 5, 0x7E7E7E) $oObj = _WinAPI_SelectObject($hMagDC, $hPen) While 1 ; Check if cursor has moved $aMouse_Pos = MouseGetPos() If $aMouse_Pos[0] <> $iLast_Mouse_X Or $aMouse_Pos[1] <> $iLast_Mouse_Y Then ; Redraw Mag GUI Loupe($aMouse_Pos) ; Reset position $iLast_Mouse_X = $aMouse_Pos[0] $iLast_Mouse_Y = $aMouse_Pos[1] EndIf WEnd Func On_Exit() ; Clear up Mag GUI _WinAPI_SelectObject($hMagDC, $oObj) _WinAPI_DeleteObject($hPen) _WinAPI_ReleaseDC(0, $hDeskDC) _WinAPI_ReleaseDC($hMag_GUI, $hMagDC) GUIDelete($hMag_GUI) Exit EndFunc ;==>On_Exit Func Loupe($aMouse_Pos) Local $iX, $iY ; Fill Mag GUI with 5x expanded contents of desktop area (10 pixels around mouse) DllCall("gdi32.dll", "int", "StretchBlt", _ "int", $hMagDC, "int", 0, "int", 0, "int", 100, "int", 100, _ "int", $hDeskDC, "int", $aMouse_Pos[0] - 10, "int", $aMouse_Pos[1] - 10, "int", 20, "int", 20, _ "long", $SRCCOPY) ; Keep Mag GUI on screen If $aMouse_Pos[0] < (@DesktopWidth - 120) Then $iX = $aMouse_Pos[0] + 20 Else $iX = $aMouse_Pos[0] - 120 EndIf If $aMouse_Pos[1] < (@DesktopHeight - 150) Then $iY = $aMouse_Pos[1] + 20 Else $iY = $aMouse_Pos[1] - 120 EndIf WinMove($hMag_GUI, "", $iX, $iY, 100, 100) EndFunc ;==>Loupe M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Ontosy Posted February 22, 2016 Author Share Posted February 22, 2016 This script zoom but not split the screen in zoomed area and normal area. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 22, 2016 Moderators Share Posted February 22, 2016 Ontosy, All I said was that the script would "give you some ideas" - not that it was a working solution. Now you can see how to use AutoIt to magnify an area, you can develop that to create the result you want. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Ontosy Posted February 22, 2016 Author Share Posted February 22, 2016 I know how to magnify but how to split the screen. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 22, 2016 Moderators Share Posted February 22, 2016 Ontosy, It looks to me as if the magnified area is just a resizeable GUI. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Exit Posted February 22, 2016 Share Posted February 22, 2016 13 minutes ago, Ontosy said: I know how to magnify but how to split the screen. in magifier, press ctrl+alt+d to dock the magnifier window. Click on magnifier window and move it to the bottom or top. App: Au3toCmd UDF: _SingleScript() Link to comment Share on other sites More sharing options...
Ontosy Posted February 22, 2016 Author Share Posted February 22, 2016 I know how to split the screen with magnify.exe but i ask how to do with autoit3. Link to comment Share on other sites More sharing options...
qwert Posted February 22, 2016 Share Posted February 22, 2016 @Melba23: This is an interesting script. But I can't follow the magnification method. When I increase the magnify window size from 100x100 to 400x400, for example, the magnification gets huge. What is controlling the magnification factor? IOW, what would give a 2x magnification? Thanks in advance for assistance. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 22, 2016 Moderators Share Posted February 22, 2016 qwert, The secret is the "StretchBlt" call which automatically adjusts the original area to fit the required size. In the case I posted, you got a 5x magnification because of this: ; Fill Mag GUI with 5x expanded contents of desktop area (10 pixels around mouse) DllCall("gdi32.dll", "int", "StretchBlt", _ "int", $hMagDC, "int", 0, "int", 0, "int", 100, "int", 100, _ "int", $hDeskDC, "int", $aMouse_Pos[0] - 10, "int", $aMouse_Pos[1] - 10, "int", 20, "int", 20, _ "long", $SRCCOPY) ; Original 20 x 20 expanded to 100 x 100 - 5x magnification If you wanted a 2x magnification you just adjust the size of the original area like this ; Fill Mag GUI with 2x expanded contents of desktop area (25 pixels around mouse) DllCall("gdi32.dll", "int", "StretchBlt", _ "int", $hMagDC, "int", 0, "int", 0, "int", 100, "int", 100, _ "int", $hDeskDC, "int", $aMouse_Pos[0] - 25, "int", $aMouse_Pos[1] - 25, "int", 50, "int", 50, _ ; Original 50 x 50 expanded to 100 x 100 - 2x magnification Note you also have to change the top and left coordinates for the original area ($aMouse_Pos[0/1] - 10/25) to maintain the mouse cursor in the central position 0f the original area. All clear? M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
qwert Posted February 22, 2016 Share Posted February 22, 2016 Got it! Thanks very much. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 22, 2016 Moderators Share Posted February 22, 2016 qwert, No problem. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area 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