Affe 1 Posted May 25, 2010 Looking to see if there is a function or way to get and set the zoom property for IE. I can change it manually by sending CTRL+ or CTRL-, but I don't know of a way to read the current zoom level (and am hoping for a simple way to set the zoom level). Thanks in advance [center][/center] Share this post Link to post Share on other sites
PsaltyDS 39 Posted May 25, 2010 (edited) This only tested with IE8: #include <IE.au3> $sURL = "http://www.autoitscript.com" $oIE = _IECreate($sURL, 1) $oScreen = $oIE.document.parentwindow.screen $iXDPI = $oScreen.deviceXDPI $iYDPI = $oScreen.deviceYDPI $iLogicalXDPI = $oScreen.logicalXDPI $iLogicalYDPI = $oScreen.logicalYDPI $iXZoom = $iXDPI / $iLogicalXDPI * 100 $iYZoom = $iYDPI / $iLogicalYDPI * 100 ConsoleWrite("$iXDPI = " & $iXDPI & "; $iYDPI = " & $iYDPI & @LF) ConsoleWrite("$iLogicalXDPI = " & $iLogicalXDPI & "; $iLogicalYDPI = " & $iLogicalYDPI & @LF) ConsoleWrite("Horizontal Zoom = %" & $iXZoom & "; Vertical Zoom = %" & $iYZoom & @LF) The typical normal (%100) zoom = 96DPI, but that is checked against the "logicalDPI" property. Edited May 25, 2010 by PsaltyDS Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Share this post Link to post Share on other sites
Affe 1 Posted May 25, 2010 This only tested with IE8: #include <IE.au3> $sURL = "http://www.autoitscript.com" $oIE = _IECreate($sURL, 1) $oScreen = $oIE.document.parentwindow.screen $iXDPI = $oScreen.deviceXDPI $iYDPI = $oScreen.deviceYDPI $iLogicalXDPI = $oScreen.logicalXDPI $iLogicalYDPI = $oScreen.logicalYDPI $iXZoom = $iXDPI / $iLogicalXDPI * 100 $iYZoom = $iYDPI / $iLogicalYDPI * 100 ConsoleWrite("$iXDPI = " & $iXDPI & "; $iYDPI = " & $iYDPI & @LF) ConsoleWrite("$iLogicalXDPI = " & $iLogicalXDPI & "; $iLogicalYDPI = " & $iLogicalYDPI & @LF) ConsoleWrite("Horizontal Zoom = %" & $iXZoom & "; Vertical Zoom = %" & $iYZoom & @LF) The typical normal (%100) zoom = 96DPI, but that is checked against the "logicalDPI" property. Awesome, thanks! Is there a way to set it, aside from CTRL+ and CTRL-? I only ask because a custom level would be more ideal than the standard 25% changes. If not, no biggie, and thanks again! [center][/center] Share this post Link to post Share on other sites
PsaltyDS 39 Posted May 25, 2010 Awesome, thanks! Is there a way to set it, aside from CTRL+ and CTRL-? I only ask because a custom level would be more ideal than the standard 25% changes.If not, no biggie, and thanks again!According to MSDN, the .deviceXDPI property is read only. Don't have time to look into setting it. You might find a .zoom() method attached to .screen or .ParentWindow objects. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Share this post Link to post Share on other sites