Sbarabau Posted September 14, 2010 Share Posted September 14, 2010 (edited) How can i change the zoom of a IE object, created with the function _IECreateEmbedded? Thank you in advance, Sbarabau Edited September 14, 2010 by Sbarabau Link to comment Share on other sites More sharing options...
PsaltyDS Posted September 14, 2010 Share Posted September 14, 2010 (edited) Something to get you started. That just reads the current setting.You can root around in the DOM methods on MSDN (I never did find it) or just use ControlSend(): WinActivate("[CLASS:IEFrame; TITLE:Google]", "") ControlSend("[CLASS:IEFrame; TITLE:Google]", "", "[CLASS:Internet Explorer_Server; INSTANCE:1]", "^{+}") Sleep(500) ControlSend("[CLASS:IEFrame; TITLE:Google]", "", "[CLASS:Internet Explorer_Server; INSTANCE:1]", "^{+}") Sleep(2000) ControlSend("[CLASS:IEFrame; TITLE:Google]", "", "[CLASS:Internet Explorer_Server; INSTANCE:1]", "^{-}") Sleep(500) ControlSend("[CLASS:IEFrame; TITLE:Google]", "", "[CLASS:Internet Explorer_Server; INSTANCE:1]", "^{-}")Edit: Clarity. Edited September 14, 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 Link to comment Share on other sites More sharing options...
Sbarabau Posted September 16, 2010 Author Share Posted September 16, 2010 And for set the zoom of an internet obj created with the function _IECreateEmbedded? Link to comment Share on other sites More sharing options...
PsaltyDS Posted September 17, 2010 Share Posted September 17, 2010 It's still the same in most respects as a full instance of IE. 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 Link to comment Share on other sites More sharing options...
Sbarabau Posted September 18, 2010 Author Share Posted September 18, 2010 Can you give me an example? I tried, but the zoom does not change with the obj created with _IECreateEmbedded... Link to comment Share on other sites More sharing options...
PsaltyDS Posted September 20, 2010 Share Posted September 20, 2010 There is no zoom in an IE ActiveX control (embedded) instance, even when done manually. So as far as I know you're out of luck. Exactly as with the full IE instance, XDPI and YDPI are there for read-only reference, though: expandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <IE.au3> _IEErrorHandlerRegister () $oIE = _IECreateEmbedded () GUICreate("Embedded Web control Test", 640, 580, _ (@DesktopWidth - 640) / 2, (@DesktopHeight - 580) / 2, _ $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS + $WS_CLIPCHILDREN) $GUIActiveX = GUICtrlCreateObj($oIE, 10, 40, 600, 360) $GUI_Button_Back = GUICtrlCreateButton("Back", 10, 420, 100, 30) $GUI_Button_Forward = GUICtrlCreateButton("Forward", 120, 420, 100, 30) $GUI_Button_Home = GUICtrlCreateButton("Home", 230, 420, 100, 30) $GUI_Button_Stop = GUICtrlCreateButton("Stop", 340, 420, 100, 30) GUISetState() ;Show GUI _IENavigate ($oIE, "http://www.autoitscript.com") $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) ; Waiting for user to close the window While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $GUI_Button_Home _IENavigate ($oIE, "http://www.autoitscript.com") Case $msg = $GUI_Button_Back _IEAction ($oIE, "back") Case $msg = $GUI_Button_Forward _IEAction ($oIE, "forward") Case $msg = $GUI_Button_Stop _IEAction ($oIE, "stop") EndSelect WEnd GUIDelete() Exit sudeepjd and mLipok 2 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 Link to comment Share on other sites More sharing options...
Sbarabau Posted September 20, 2010 Author Share Posted September 20, 2010 But there's no way to send a check to the page embedded with the command: ControlSend("[CLASS:IEFrame; TITLE:Google]", "", "[CLASS:Internet Explorer_Server; INSTANCE:1]", "^{+}") ? Link to comment Share on other sites More sharing options...
PsaltyDS Posted September 20, 2010 Share Posted September 20, 2010 But there's no way to send a check to the page embedded with the command: ControlSend("[CLASS:IEFrame; TITLE:Google]", "", "[CLASS:Internet Explorer_Server; INSTANCE:1]", "^{+}") ? You lost me. We were talking about zoom level, and now "...there's no way to send a check to the page embedded...". What do you mean by "send a check"? The function you posted would be for a regular instance of IE, and would change the zoom level. For an embedded instance, you would have to change the window ID to that of the parent window containing the embedded IE control, and the zoom level wouldn't change anyway because that functionality is not there in an embedded browser instance, as far as I can tell. 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 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