Jump to content

Search the Community

Showing results for tags 'embedded'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Location


WWW


Interests

Found 14 results

  1. Hi, I'm developing CefAu3 project, it embed Chromium browser to your AutoIt program. I'm busy and can stop it. If you want to contribute, you can fork my project and build it yourself. Some Features: - Easy create CEF window - Multi-message loop - Interaction between AutoIt and JavaScript - Supports AutoIt binding - Supports user events... Github: https://github.com/wy3/cefau3 MiniBrowser: https://github.com/small-autoit/mb CEF project: https://bitbucket.org/chromiumembedded/cef Learn more: http://magpcss.org/ceforum/
  2. IE Embedded Control Versioning Use IE 9+ and HTML5 features inside a GUI This UDF allows the use of embedded IE controls which support IE versions greater than IE 7. By default, all embedded IE controls default to IE 7 compatibility mode (unless for some reason somebody has IE 6 installed!), so its not possible to use most of the HTML5 features available today. Fortunately, IE 9 and greater allow the use of HTML5, and the embedded IE control actually supports it. The problem is convincing Windows to let your program actually use those features! There are Registry branches that modify how an IE control works in specific programs. Those branches are: HKCU\Software\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION HKLM\SOFTWARE\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION In at least one of these branches, the executable name needs to appear as a value name ("autoit.exe" for example), and the value data needs to indicate what IE version to 'emulate'. The value data is actually dependent on the version and whether quirks-mode is enabled. See Web Browser Control - Specifying the IE Version for more information. Note that a 64-bit O/S needs adjustments to the HKLM paths. Also, prefer the HKCU branch unless the program needs to enable access across all user accounts. HTML5 Canvas Element Example Anyway, all the complexity of setting the right value with the right name with the right 32/64-bit branch is handled for you in this UDF. Enabling support for IE9+, and new HTML5 features, is as simple as making one call to _IE_EmbeddedSetBrowserEmulation(). _IE_EmbeddedSetBrowserEmulation() takes an executable name (@AutoItExe if none is provided), and checks the Registry for an entry for it. If it doesn't find one, it will create one and enable support for later versions of IE. The full parameters to the function are as follows: _IE_EmbeddedSetBrowserEmulation($nIEVersion, $bIgnoreDOCTYPE = True, $bHKLMBranch = False, $sExeName = @AutoItExe) The parameter passed in $nIEVersion can be anything from 8 to 11 [or 12+ in the future], or just the current version of IE, which is available also through a call to _IE_EmbeddedGetVersion(). $bIgnoreDOCTYPE controls when IE will go into quirks mode based on any "<!DOCTYPE>" declarations on webpages. This mode can cause major problems, so by default it is set to ignore it (set this to False to enable it). $bHKLMBranch controls where in the registry the Browser Emulation Mode setting will be stored. If you wish to store the mode for ALL users, set this parameter to True. Note, however, that elevated privileges are required for modifying the HKLM branch! If the call to _IE_EmbeddedSetBrowserEmulation() is successful, then you can enable a (more) HTML5 compliant IE browser control in a GUI. The complete set of functions in the UDF: _IE_EmbeddedGetVersion() ; Gets version of IE Embeddable Control (from ieframe.dll or Registry) _IE_EmbeddedGetBrowserEmulation() ; Gets Browser Emulation Version for given Executable (or 0 if not found) _IE_EmbeddedSetBrowserEmulation() ; Sets Browser Emulation Version. NOTE: HKLM branch REQUIRES ELEVATED PRIVILEGES! _ IMPORTANT: Setting the embedded browser object to a newer version of IE may alter the behavior of some things. See documenation for the HTMLDocumentEvents2 interface and HTMLAnchorEvents2 interface for example. Also, there is at least one difference in behavior noted by mesale0077 in working with IE10 (and possibly other versions of IE) - clicks for elements inside an <a> anchor tag will register as the actual internal element rather than the surrounding anchor. For example, an <img> element wrapped by an <a> anchor will only send the click to the <img> element and not propagate it any further. A workaround for this is to check the parentNode to see if it is an <a> element. See the discussion in the >ObjEvent dont work thread. It could be that there's some other reason for this behavior, but nothing has come to light yet. As an aside, also see trancexx's response in >ObjEvent usage for more techniques for capturing IE events. History: An example of HTML5 use, which has a little interactive Canvas, follows (requires IE9 or higher!): #include "IE_EmbeddedVersioning.au3" ; =============================================================================================================================== ; <IE_EmbeddedHTML5Example.au3> ; ; Example of using 'IE_EmbeddedVersioning' UDF ; ; This example 1st attempts to set the Browser Emulation information in the registry, then ; creates an embedded IE control with an interactive HTML5 Canvas element. ; ; Author: Ascend4nt ; =============================================================================================================================== #Region IE_CANVAS_EXAMPLE #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <IE.au3> ; ----------- ; GLOBALS ; ----------- Global $bMouseDown = False, $iLastX1 = 0, $iLastY1 = 0 Global $g_oCanvas, $g_oCtx Global $hGUI, $ctGUI_ErrMessageLabel Global $GUI_IE_Obj Global $nRet = _WinMain() ; Optionally remove valuename at Exit (not recommended if compiled to executable) ;~ _IE_EmbeddedRemoveBrowserEmulation() Exit $nRet ; ====================================================================================================== ; Embedded IE Browser-Emulation Fix + HTML5 Example ; ====================================================================================================== Func _WinMain() ConsoleWrite("@AutoItX64 = " & @AutoItX64 & ", IsAdmin() = " & IsAdmin() & @CRLF) ;; Get Current IE Embeddable Control Version (from ieframe.dll) Local $sIEVer = _IE_EmbeddedGetVersion(), $nIEVer = @extended ConsoleWrite("Embedded Version = " & $sIEVer & ", as Int: " & $nIEVer & ", @error = " & @error & @CRLF) ; Old IE version w/o HTML5 support? Exit If $nIEVer < 9 Then Return MsgBox(0, "Old IE Version", "IE version is less than 9, HTML5 example will not work") ;; Current Browser Emulation Mode for this executable (if exists) Local $nIEBEVer = _IE_EmbeddedGetBrowserEmulation() ConsoleWrite("GetEmbeddedVersion: " & $nIEBEVer & ", @error = " & @error & ", @extended = " & @extended & @CRLF) ;; Set Browser Emulation Mode for this executable (if not already set or set to a different version) ; HKCU Branch: _IE_EmbeddedSetBrowserEmulation() ; HKLM Branch: ;_IE_EmbeddedSetBrowserEmulation(-1, True, True) If @error Then ; -1 error means trying to access HKLM, so script needs elevation to access the Registry If @error = -1 Then If MsgBox(32 + 3, "Elevation Required", "Elevate script to enable setting Browser Emulation Mode?") = 6 Then Return _ReRunIfNotElevated() Return 1 EndIf Return MsgBox(0, "Error", "Couldn't set Browser Emulation mode") EndIf ;Local $oErrorHandler = ObjEvent("AutoIt.Error", "_ErrFunc") ;; Create Embedded Browser Control and GUI Local $oIE = _IECreateEmbedded() ; GUI (vars are Global) $hGUI = GUICreate("Embedded Web control Test", 460, 360, -1, -1, $WS_OVERLAPPEDWINDOW + $WS_CLIPSIBLINGS + $WS_CLIPCHILDREN) $GUI_IE_Obj = GUICtrlCreateObj($oIE, 10, 10, 440, 340) $ctGUI_ErrMessageLabel = GUICtrlCreateLabel("", 100, 500, 500, 30) GUICtrlSetColor(-1, 0xff0000) GUISetState(@SW_SHOW) ;Show GUI ; Doesn't work (at least for keyboard focus): ;~ ControlFocus($hGUI, '', $GUI_IE_Obj) ;; Initialize Embedded Control and write some HTML5 data to it _IENavigate($oIE, 'about:blank' ) ; Basic Near-Empty HTML (with minimal CSS styling for Canvas element) Local $sHTML = '<!DOCTYPE html>' & @CR & '<html>' & @CR & '<head>' & @CR & _ '<meta content="text/html; charset=UTF-8" http-equiv="content-type">' & @CR & _ '<title>Experiments</title>' & @CR & _ '<style>canvas { display:block; background-color:white; outline:#00FF00 dotted thin;}</style>' & @CR & _ '</head>' & @CR & '<body>' & @CR & '</body>' & @CR & '</html>' _IEDocWriteHTML($oIE, $sHTML) _IEAction($oIE, "refresh") ;; Setup Event Object Functions Local $oEventsDoc = ObjEvent($oIE.document, "Event_", "HTMLDocumentEvents2") #forceref $oEventsDoc ;~ ConsoleWrite("Obj Name = " & ObjName($oIE) & @CRLF) ;~ ConsoleWrite("Location = " & $oIE.document.location.pathname & @CRLF) ; -------------------------------------------------------------------------------------- ; Create Canvas Element through the DOM (optionally just add it in the HTML5 above) ; ------------------------------------------------- ; Note: Support in browsers, see "Can I use..." ; @ http://caniuse.com/#feat=canvas ; and @ http://caniuse.com/#search=canvas ; ------------------------------------------------- ; IE minimum is version 9+, 10+ has more features, but WebGL support requires version 11+ ; -------------------------------------------------------------------------------------- $g_oCanvas = $oIE.document.createElement("canvas") $g_oCanvas.id = "myCanvas" ;~ ConsoleWrite("Canvas ID = " & $g_oCanvas.id & @CRLF) $oIE.document.body.appendChild($g_oCanvas) ; Optionally, if added already through the HTML5 text: ;Local $g_oCanvas = _IEGetObjById($oIE, "myCanvas") If @error Then Return MsgBox(0, "Error", "Error creating/accessing Canvas") ;; Tweak Canvas Size, Move into View ;~ ConsoleWrite("window innerwidth = " & $oIE.document.parentWindow.innerWidth & @CRLF) ;$oIE.document.parentWindow.scrollTo(0, 10) $g_oCanvas.width = 420 $g_oCanvas.height = 320 ;ConsoleWrite("Canvas item offsetTop = " & $g_oCanvas.offsetTop & @CRLF) $g_oCanvas.scrollIntoView() ;; Grab the Canvas 2D Context $g_oCtx = $g_oCanvas.getContext("2d") ;; Example Drawing: Gradiant Local $oGrad = $g_oCtx.createLinearGradient(0,0,0,60) If IsObj($oGrad) Then $oGrad.addColorStop(0, "red") $oGrad.addColorStop(1, "blue") $g_oCtx.fillStyle = $oGrad EndIf $g_oCtx.fillRect(0,0,419,60) ;; Example Drawing: Text $g_oCtx.font = "30px serif" $g_oCtx.fillStyle = "white" $g_oCtx.textBaseline = "top" $g_oCtx.fillText("HTML5 Canvas Drawing!", 50, 10) ;; Example Drawing: Circle, Line $g_oCtx.beginPath() $g_oCtx.arc(200, 100, 20, 0, ACos(-1) * 2) $g_oCtx.fillStyle = "red" $g_oCtx.fill() $g_oCtx.beginPath() $g_oCtx.lineWidth = "3" $g_oCtx.strokeStyle = "green" $g_oCtx.moveTo(185, 85) $g_oCtx.lineTo(215, 115) $g_oCtx.stroke() ; Waiting for user to close the window While GUIGetMsg() <> $GUI_EVENT_CLOSE Sleep(10) WEnd GUIDelete() EndFunc ; ====================================================================================================== ; IE Event Functions - React to Mouse events with some Canvas graphics ; ====================================================================================================== #Region IE_EVENT_FUNCS ; For right-click, the context menu pops up, UNLESS we change the Event's 'returnValue' property Volatile Func Event_oncontextmenu($oEvtObj) If IsObj($oEvtObj) Then ; Convert to string so that 0 doesn't match EVERY string Local $sId = $oEvtObj.srcElement.id & "" If ($sId = "myCanvas") Then $oEvtObj.returnValue = False EndIf EndFunc Volatile Func Event_onmousedown($oEvtObj) If IsObj($oEvtObj) And IsObj($g_oCtx) Then ; Map click coordinates to Canvas coordinates $iLastX1 = $oEvtObj.x - $g_oCanvas.offsetLeft $iLastY1 = $oEvtObj.y - $g_oCanvas.offsetTop ;~ ConsoleWrite("Downclick recvd at X1: " & $iLastX1 & ", Y1: " & $iLastY1 & ", MouseButton [1 = left, 2 = right, etc] = " & $oEvtObj.button & @CRLF) ; Check if click was in fact within Canvas element If $iLastX1 >= 0 And $iLastX1 < $g_oCanvas.width And $iLastY1 >= 0 And $iLastY1 < $g_oCanvas.height Then ; Signal mouse-down occurred inside Canvas $bMouseDown = 1 ; Make a small square where initial down-click was detected $g_oCtx.fillStyle = "blue" $g_oCtx.fillRect($iLastX1 - 2, $iLastY1 - 2, 3, 3) EndIf EndIf EndFunc Volatile Func Event_onmouseup($oEvtObj) If IsObj($oEvtObj) And IsObj($g_oCtx) Then ;~ ConsoleWrite("MouseUp" & @LF) If $bMouseDown Then Local $iX = $oEvtObj.x - $g_oCanvas.offsetLeft, $iY = $oEvtObj.y - $g_oCanvas.offsetTop ; Random color in "#0f1100" (RGB) string form Local $sColor = "#" & Hex(Random(0, 255, 1), 2) & Hex(Random(0, 255, 1), 2) & Hex(Random(0, 255, 1), 2) ;; Draw either a line or circle depending on where the mouse button is released If $iX = $iLastX1 And $iY = $iLastY1 Then ; Circle if mouse start = mouse end $g_oCtx.beginPath() $g_oCtx.arc($iX, $iY, 8, 0, ACos(-1) * 2) $g_oCtx.fillStyle = $sColor $g_oCtx.fill() Else ; Line if mouse start <> mouse end $g_oCtx.beginPath() $g_oCtx.lineWidth = "3" $g_oCtx.strokeStyle = $sColor $g_oCtx.moveTo($iLastX1, $iLastY1) $g_oCtx.lineTo($iX, $iY) $g_oCtx.stroke() EndIf $bMouseDown = 0 EndIf EndIf EndFunc Volatile Func Event_onkeydown($oEvtObj) If IsObj($oEvtObj) Then ConsoleWrite("Event type: " & $oEvtObj.type & "id (0 is document) = " & $oEvtObj.srcElement.id) ConsoleWrite(", keycode = " & $oEvtObj.keyCode & ", shiftkey = " & $oEvtObj.shiftKey & @CRLF) EndIf EndFunc ; ====================================================================================================== #EndRegion IE_EVENT_FUNCS #EndRegion IE_CANVAS_EXAMPLE #Region UTIL_FUNCS ; ====================================================================================================== ; Func _ReRunIfNotElevated() ; ; Does what it says. (rumored to occasionally say what it does) ; ; Author: Ascend4nt ; ====================================================================================================== Func _ReRunIfNotElevated() If IsAdmin() Then Return 0 Else If @Compiled Then ; If compiled to A3X, we need to execute it as if not compiled. Local $sCmd = (@AutoItExe = @ScriptFullPath) ? "" : ("/AutoIt3ExecuteScript " & @ScriptFullPath) Return ShellExecute(@AutoItExe, $sCmd, @ScriptDir, "runas") Else Return ShellExecute(@AutoItExe,@ScriptFullPath,@ScriptDir,"runas") EndIf EndIf EndFunc #EndRegion UTIL_FUNCS IEEmbeddedVersioning.zip ~prev Downloads: 61 Also, HTML5+Javascript standalone Canvas demo (should run in any browser): HTML5StandaloneCanvasDemo.zip
  3. CreateFilesEmbedded.exe Application to embed files into their programs in the format .AU3 I present a different format to add files in your script: So how about having our files (photos, text, executables) built? 1 - We can use the binary variables with 2 - We can test the fully functional program with F5 SciTE 4 - Use your imagination!!! Sintax / Examples: #include "YourFileEmbedded.au3" ; Returning the code in binary format $bData = _YourFileEmbedded() ; Saving the code in the HDD _YourFileEmbedded( True, @ScriptDir) ; Saving and running the code _YourFileEmbedded( True, @ScriptDir, True) ; Finally, running the code directly Run(_YourFileEmbedded(True))Language file sample: Supports: ; All file types! Downloads: Version: 2.27 CreateFilesEmbedded_(RedirectLink).html (Previous downloads: 575) Example using the binary return (without writing the file in HDD) BinarySoundTest.zip Sample: Fixes: Free Software João Carlos.
  4. Hello everyone, I encountered this strange issue while working on a freelance project, I cannot give you the webpage/website on which this is happening because it is an internal site which is inaccessible externally. I am attempting to create a GUI with an IE control embedded in it, but when I navigate to the desired address, it shows a blank white page. The webpage does load if I use a different browser or normal (non-embedded) IE instance. I managed to get my hands on the source of the blank page: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <link rel="stylesheet" type="text/css" href="res://ieframe.dll/ErrorPageTemplate.css" /> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Navigationen blev annulleret</title> <script src="res://ieframe.dll/errorPageStrings.js" language="javascript" type="text/javascript"> </script> <script src="res://ieframe.dll/httpErrorPagesScripts.js" language="javascript" type="text/javascript"> </script> </head> <body onLoad="javascript:navCancelInit(); "> <table width="730" cellpadding="0" cellspacing="0" border="0"> <!-- Error title --> <tr> <td id="infoIconAlign" width="60" align="left" valign="top" rowspan="2"> <img src="res://ieframe.dll/info_48.png" id="infoIcon" alt="Oplysningsikon"> </td> <td id="mainTitleAlign" valign="middle" align="left" width="*"> <h1 id="mainTitle">Navigationen til websiden blev annulleret</h1> </td> </tr> <tr> <!-- This row is for HTTP status code, as well as the divider--> <td id="errorCodeAlign" class="errorCodeAndDivider" align="right">&nbsp; <div class="divider"></div> </td> </tr> <!-- Error Body --> <!-- What you can do --> <tr> <td> &nbsp; </td> <td id="whatToTryAlign" valign="top" align="left"> <h2 id="whatToTry">Prøv at:</h2> </td> </tr> <!-- refresh page --> <tr> <td > &nbsp; </td> <td id="refreshPageAlign" align="left" valign="middle"> <h4> <table> <tr> <td valign="top"> <img src="res://ieframe.dll/bullet.png" border="0" alt="" class="actionIcon"> </td> <td valign="top"> <span id="navCancelContainer"></span><noscript id="refreshPage">Opdatere siden.</noscript> </td> </tr> </table> </h4> </td> </tr> </table> </body> </html> The ieframe.dll resources are a point of interest. I am not sure how the server is able to detect the embedded instance of IE ... Any suggestions? Here is a basic outline of the script: #include <IE.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Main() While True Sleep(1000) WEnd Func Main() ; Create GUI $hGUI = GUICreate("", $GUI_WIDTH, $GUI_HEIGHT, $iLeft, $iTop, $WS_POPUP) $oIE = _IECreateEmbedded() ;$oIE = _IECreate() ; This works, but it is not embedded in the GUI GUICtrlCreateObj($oIE, 0, 0, $GUI_WIDTH, $GUI_HEIGHT) GUISetState() ; Navigate to the URL and authenticate _IENavigate($oIE, $URL) EndFunc Thank you for the advice in advance!
  5. Hey Guys, Hope that you can help me with something, maybe this is a bug in the new version of AUTOIT but first i will check it with you to know for sure. I have made a simple GUI with a Embedded IE Object, then i would like to read the HTML with _IEBodyReadHTML(), easy right? When i use the old IE.au3 include from a year back or so, it is working fine! When i use the new IE.au3 include came with the new installation that is currently available on autoitscript.com it isnt working (i get a result that says; 0). Let me show you. Working Example #include <GUIConstantsEx.au3> #include <IE_EmbeddedVersioning.au3> #include <IE_PreVersion.au3> ;Older Version Example() Func Example() ; Create a GUI with various controls. Local $hGUI = GUICreate("Example", 1000, 1000) Local $idOK = GUICtrlCreateButton("OK", 310, 370, 85, 25) Global $oIE_1 = _IECreateEmbedded() ; CREATE IE OBJECT(S) GUICtrlCreateObj($oIE_1, 355, 5, 600, 360) _IENavigate($oIE_1, "https://www.google.nl", 1) Local $CheckHTML_T = _IEBodyReadHTML($oIE_1) ; Display the GUI. GUISetState(@SW_SHOW, $hGUI) MsgBox(48,"",$CheckHTML_T) ; Loop until the user exits. While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE, $idOK ExitLoop EndSwitch WEnd ; Delete the previous GUI and all controls. GUIDelete($hGUI) EndFunc ;==>Example Failing Example #include <GUIConstantsEx.au3> #include <IE_EmbeddedVersioning.au3> #include <IE.au3> ;New Version Example() Func Example() ; Create a GUI with various controls. Local $hGUI = GUICreate("Example", 1000, 1000) Local $idOK = GUICtrlCreateButton("OK", 310, 370, 85, 25) Global $oIE_1 = _IECreateEmbedded() ; CREATE IE OBJECT(S) GUICtrlCreateObj($oIE_1, 355, 5, 600, 360) _IENavigate($oIE_1, "https://www.google.nl", 1) Local $CheckHTML_T = _IEBodyReadHTML($oIE_1) ; Display the GUI. GUISetState(@SW_SHOW, $hGUI) MsgBox(48,"",$CheckHTML_T) ; Loop until the user exits. While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE, $idOK ExitLoop EndSwitch WEnd ; Delete the previous GUI and all controls. GUIDelete($hGUI) EndFunc ;==>Example I have attachted all files and i am testing on Windows 10 with the latest SciTe Program (Not compiled). When i compile the script it is showing the same result. Thanks guys! IE_PreVersion.au3 IE.au3 IE_EmbeddedVersioning.au3
  6. I have a problem here. I have a Script wich opens a Gui with an iExplore Object embedded. The GuiCreate is in an external Function an called in the main while of the script. When the Gui closes the Gui gets destoyed. But unfortunately the iExplore Obejct still remains. You can see this by the RAM usage of the exe. After opening a Website the RAM usage stays at ~ 50 Mb RAM (depending on the website). I want it to fall back to the normal state (around 4 MB). You can see my attempts to delete the object properly. According to the help an embedded object should get deleted when the GUI gets deleted ...? GUICreate("Display", 600, 360, -1, -1) Local $oIE = _IECreateEmbedded() $obj = GUICtrlCreateObj($oIE, 0, 0, 600, 360) GUICtrlSetColor(-1, 0xff0000) _IEPropertySet($oIE, "addressbar", False) _IEPropertySet($oIE, "menubar", False) _IEPropertySet($oIE, "statusbar", False) _IEPropertySet($oIE, "toolbar", False) _IEPropertySet($oIE, "resizable", False) _IENavigate($oIE, $dest&"\index.html") GUISetState(@SW_SHOW) While 1 Local $iMsg = GUIGetMsg() Local $tmsg = TrayGetMsg() Select Case $iMsg = $GUI_EVENT_CLOSE ;~ $obj = 0 ;~ _WinAPI_DeleteObject ( $obj ) ;~ _IEQuit($obj) ;~ _MemGlobalFree($obj) ;~ $oIE = 0 ;~ _WinAPI_DeleteObject ( $oIE ) ;~ _IEQuit($oIE) ;~ _MemGlobalFree($oIE) GUIDelete() Case $tmsg = $exit _exit() EndSelect WEnd I would be very happy for your help Kind regards
  7. Hello all! I'm trying to figure out how to display the contents of my Microsoft Outlooks inbox inside of an AutoIt GUI. So far, I've managed to embed it perfectly and the website looks fantastic, but whenever I click on a message in my inbox, I can't view it. I also can't create new messages or search my inbox. I figured this was probably an ActiveX or JavaScript incompatibility. Any ideas? Local $oIE = _IECreateEmbedded() $browserObj = GUICtrlCreateObj($oIE, 20, 60, 780, 580) _IENavigate($oIE, "https://outlook.office.com/owa/#path=/mail")
  8. Hey, I just created this program to make it easier to get straight to the videos on "www.couchtuner.ch". Can I get some help improving it by adding a Internet Explorer window that will have the embeded videos from this website. TV List.au3
  9. I have IE 10 installed, so I assume the embedded is using the same. If I make a test html doc that has a DIV with inline style of "border-radius:8px 8px 8px 8px;" this radius works if I browse the file with normal IE 10 --- but if I am embedding IE in a form and using _IEPropertySet($oIE, 'innerhtml', $html) with the exact same html that is in the file, the border-radius does not work. #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <IE.au3> _IEErrorHandlerRegister() Local $oIE = _IECreateEmbedded() Global $thisfile="C:\batch\borg\TestCreeper.au3" Global $logg="C:\$data\logs\TestCreeper-log.txt"; Global $timestamp=@YEAR&"."&@MON&"."&@MDAY&"."&@HOUR&"."&@MIN&"."&@SEC&"."&@MSEC Global $f_w=800 Global $f_h=400 Global $hgui=GUICreate("Embedded Web control Test", $f_w, $f_h, _ (@DesktopWidth - $f_w) / 2, (@DesktopHeight - $f_h) / 2, _ $WS_POPUP) GUICtrlCreateObj($oIE, -2, -2, $f_w+30, $f_h+8) GUISetState() ;Show GUI _IENavigate($oIE, "about:blank") Global $st='body { background-color:black;margin: 0; padding: 0; } ' Global $tx='Mary had a little lamb, little lamb, little lamb, little lamb, whose fleece was white as snow' ;THIS DOESNT WORK, SPECIFYING EACH INDIVIDUALLY Global $br=BorderRadiusTxt(8) ;MsgBox(0,$thisfile,$br) ;NONE OF THE FOLLOWING WORK $br='border-radius:8px;' $br='-ms-border-radius:8px;' $br='-webkit-border-radius:8px;' $br='-moz-border-radius:8px;' $br='border-radius:8px 8px 8px 8px;' $br='-ms-border-radius:8px 8px 8px 8px;' $br='-webkit-border-radius:8px 8px 8px 8px;' $br='-moz-border-radius:8px 8px 8px 8px;' ;WORKS IN IE, BUT NOT IN EMBEDDED <<<<<=== HERE $br='border-radius:8px 8px 8px 8px;' Global $t=''; $t&='<div style="position:absolute;'&$br&'border:1px solid green;background-color:black;padding:12px;color:#ccc;font-family:Tahoma;height:10px;top:10px;left:10px;">' $t&=$tx $t&='</div>' Global $body_tags='border="0" marginheight="0" topmargin="0" vspace="0" marginwidth="0" leftmargin="0" hspace="0" ' Global $html='<HTML><HEAD><STYLE type="text/css">'&$st&'</STYLE></HEAD><BODY '&$body_tags&'>'&$t&'</BODY></HTML>' ;MsgBox(0,$thisfile,$html) ;ClipPut($html) Global $r=_IEPropertySet($oIE,'innerhtml',$html) ; Waiting for user to close the window While 1 Local $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop EndSelect WEnd GUIDelete() Func BorderRadiusTxt($i) Return 'border-top-left-radius:'&$i&'px;' & _ 'border-top-right-radius:'&$i&'px;' & _ 'border-bottom-left-radius:'&$i&'px;' & _ 'border-bottom-right-radius:'&$i&'px' EndFunc ;;;;;;functions Func ts() Return @YEAR&"."&@MON&"."&@MDAY&"."&@HOUR&"."&@MIN&"."&@SEC&"."&@MSEC EndFunc Func logline($line) Local $fh1=FileOpen($logg,1); If $fh1<>-1 Then FileWriteLine($fh1,$line) FileClose($fh1) EndIf EndFunc
  10. A3X Script Extract With newer versions of AutoIT (v3.3.10.0+), the compiled script is no longer appended to files as an overlay, and instead is embedded as a binary resource. This leads my previous AutoIt-script detection UDF lacking. However, since that UDF (>PE File Overlay Extraction) was targeted towards overlays in general, its still a worthwhile tool to have. This UDF on the other hand is pretty specific - it lets you detect and optionally extract A3X scripts from a compiled executable. The method is rather straightforward - it looks for a resource type of RT_RCDATA with a resource name of "SCRIPT", and then extracts the binary, testing for the A3X signature along the way. The main UDF has two functions: _FileContainsScriptResource() _FileContainsA3XScript() The first of these functions is there only for checking if a resource with "SCRIPT" exists. Its main purpose is to report on possible embedded scripts. I made this a separate function primarily because of issues with compressed executables. Tools like UPX and MPRESS can compress the resources as well as the rest of the executable, so any detection of the A3X signature will fail in those circumstances. (Note that UPX and MPRESS don't compress overlay data, which is why the older Overlay-Extraction A3X-detection worked regardless) The second function will both check for and optionally return the A3X script resource as binary. It also does a signature check for verification. Anyway, here's an example of its usage. The main UDF is attached below. #include <_FileContainsA3XScript.au3> ; ======================================================================================================== ; <A3XScriptExtract.au3> ; ; Example of detecting AutoIt Scripts embedded as binary resources (in AutoIt v3.3.10.0+ exe's), and ; extracting them to .A3X files. ; ; This script can be invoked in interactive or command-line mode. ; Passing an executable as a parameter will extract an A3X resource, writing it out to ; an A3X file with the same base name as the executable. ; ; Uses <_FileContainsA3XScript.au3> functions ; ; Author: Ascend4nt ; ======================================================================================================== ; ---------------------- MAIN CODE ------------------------------- Local $sFile, $sLastDir, $sLastFile, $binA3X, $iErr, $nA3XSize ; Command-line parameter received? Simply do a direct A3X extraction If $CmdLine[0] Then $sFile = $CmdLine[1] If Not FileExists($sFile) Then Exit 1 $binA3X = _FileContainsA3XScript($sFile, True) If @error Then Exit @error $nA3XSize = @extended Local $nExt = StringInStr($sFile, '.', 0, -1) If $nExt Then $sFile = StringLeft($sFile, $nExt - 1) EndIf $sFile &= '.a3x' Exit Not FileWrite($sFile, $binA3X) EndIf ; No command-line parameters, query the user in interactive mode $sLastDir = @ScriptDir While 1 $sFile=FileOpenDialog("Select PE File To Look for Embedded A3X scripts In",$sLastDir,"PE Files (*.exe;*.dll;*.scr)|All Files (*.*)",3,$sLastFile) If @error Or $sFile="" Then Exit $sLastFile = StringMid($sFile, StringInStr($sFile, '\', 1, -1) + 1) $sLastDir = StringLeft($sFile, StringInStr($sFile, '\', 1, -1) - 1) ; Resource 'Script' check $bScriptResourceFound = _FileContainsScriptResource($sFile) ConsoleWrite("_FileContainsScriptResource() return: " & $bScriptResourceFound & ", @error = " & @error & ", @extended = " & @extended & @CRLF) ; Actual A3X script resource check. True to return the A3X script as binary $binA3X = _FileContainsA3XScript($sFile, True) $iErr = @error $nA3XSize = @extended ; No A3X script found? If $iErr Or $nA3XSize = 0 Then ConsoleWrite("Failed Return from _FileContainsA3XScript(), @error = " & $iErr & ", @extended = " & $nA3XSize & @CRLF) MsgBox(64, "No AutoIt A3X script resource Found", "AutoIt A3X script resource not Found!" & @CRLF & _ ($bScriptResourceFound ? "However, *A* script resource was found" : "No 'Script' resource found either") & @CRLF & _ "for '" & $sLastFile & "'") ContinueLoop EndIf ConsoleWrite("_FileContainsA3XScript() return type: " & VarGetType($binA3X) & ", value = " & (IsBinary($binA3X) ? "[A3X_Binary]" : $binA3X) & @CRLF) ConsoleWrite(@TAB & "@error = " & $iErr & ", @extended = " & $nA3XSize & @CRLF) Local $hFileOut = -1, $sOutFile, $iMsgBox, $bSuccess = 0 $iMsgBox = MsgBox(35, "A3X script resource found in " & $sLastFile, "A3X script resource found. File size: " & FileGetSize($sLastFile) & _ ", A3X script size: " & $nA3XSize & @CRLF & @CRLF & _ "Would you like to Extract and save A3X file?") If $iMsgBox = 6 Then ;~ If $nA3XSize > 134217728 Then ;~ MsgBox(48, "A3X script is too huge", "A3X script size is > 128MB, skipping..") ;~ ContinueLoop ;~ EndIf $sOutFile = FileSaveDialog("A3X script - SAVE: Choose a file to write A3X script data to (from " & $sLastFile&")", _ $sLastDir, "AutoIt Compiled Sript (*.a3x)|All (*.*)", 2 + 16) If @error Then ContinueLoop ; Simple check for extension - if none, add .a3x If StringInStr($sOutFile, '.') = 0 Then $sOutFile &= ".a3x" ; Else $hFileOut = FileOpen($sOutFile, 16 + 2) If $hFileOut <> - 1 Then $bSuccess = FileWrite($hFileOut, $binA3X) FileClose($hFileOut) EndIf Else ContinueLoop EndIf If $bSuccess Then ShellExecute(StringLeft($sOutFile,StringInStr($sOutFile,'\',1,-1)-1)) Else MsgBox(64, "Error Opening or writing to file", "Error opening, reading, or saving A3X file") EndIf WEnd Exit _FileContainsA3XScript.au3 *edit: Modified example: Now alternatively accepts a command-line parameter for automated script extraction
  11. Hi All, I'm trying to write a small program that automatically logs on to a website using a username and password provided and screenshots the front page (I've checked and this is not against the site's rules). I have the script working using _IECreateEmbedded(), however for some reason the user stays logged in on the website even after I restart my machine. I will be creating a way to actually sign out of the website as well, however to me this implies that some where cookies/sessions are being stored which I do not wish to happed. So is there any way I can flush the cookies/sessions created by the IE instance or something? Thanks in advance
  12. Inspired by I took a more simplified approach that is more reliant on IE.au3. #include <WindowsConstants.au3> #include <WinAPI.au3> #include <Constants.au3> #include <IE.au3> Func IECreatePseudoEmbedded($iLeft, $iTop, $iWidth, $iHeight, $hParent, $sURL = "about:blank", $bShowWin = False) Local $iPID = Run(@ProgramFilesDir & "\Internet Explorer\iexplore.exe -k " & $sURL, "", @SW_HIDE) Sleep(2000) Local $oIE = _IEAttach($sURL, "URL", 1) Local $hWND = _IEPropertyGet($oIE, "hwnd") _WinAPI_SetParent($hWND, $hParent) _WinAPI_MoveWindow($hWND, $iLeft, $iTop, $iWidth, $iHeight, True) _WinAPI_SetWindowLong($hWND, $GWL_STYLE, $WS_POPUP + $WS_VISIBLE) If $bShowWin == True Then WinSetState($hWND, "", @SW_SHOW) EndIf Return $oIE EndFunc With this function it runs IE in kiosk mode defaulting to hidden. It will make the window a child window, resize, relocate, and redraw. It will then show the window if the ShowWin flag is set to true. It does not handle killing the process I would like to register a cleanup function if there is a way to call a function before application close. I wan't able to find a simple way to handle this just yet, so for the time being your application should call _IEQuit on application close.
  13. I haven't got any replies so i figured my question was either not worded well or i didn't give an example that you guys could use. So here is the example: cannot backspace in the edit after having clicked in the embedded IE control. How do i either avoid this or take measures to correct for this? ;========================================================================================== #include <ie.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <GUIConstantsEx.au3> #include <GuiEdit.au3> ;Mainwindow $WinMain = GUICreate("hello", 510, 510) $MainMsgBoardInput = _GUICtrlEdit_Create($WinMain, "", 1, 439, 498, 50, BitOR($ES_MULTILINE, $ES_WANTRETURN, $WS_VSCROLL, $ES_AUTOVSCROLL)) $oMainIE = _IECreateEmbedded() GUICtrlCreateObj($oMainIE, 1, 1, 498, 435) _IENavigate($oMainIE, "about:blank") ;Perform starup operations GUISetState(@SW_SHOW) While 1 $mMsg = GUIGetMsg() Switch $mMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd
  14. Hi, when I render a web page embedded in a GUI and the height of the ActiveX control is greater than 8192 pixel then the web page will be shown only as an empty white page. #include <windowsconstants.au3> $hGUI = GUICreate("", 1024, 600) GUISetState(@SW_SHOW, $hGUI) $oIE = ObjCreate("Shell.Explorer.2") $GUIActiveX = GUICtrlCreateObj($oIE, 0, 0, 1048, 8200) Global Const $BrowserNavConstant = 2 + 128 + 256 + 512 + 4096 + 3276 $t = TimerInit() With $oIE .Silent = True .FullScreen = True .Resizable = False .Visible = False .StatusBar = False .AddressBar = False .Navigate("www.stern.de", $BrowserNavConstant, "_top") Do Sleep(500) If .ReadyState = 4 Or TimerDiff($t) > 20000 Then ExitLoop Until False .Stop EndWith $oDocument = $oIE.document $oBody = $oDocument.body $oHtml = $oDocument.documentElement $oBody.scroll = "no" $oBody.style.borderStyle = "none" $oBody.style.border = "0px" $oHtml.style.overflow = 'hidden' Do Until GUIGetMsg() = -3 GUIDelete($hGUI) Versions: IE: 9.0.8112.1623 Autoit: 3.3.8.1 (running as x86) Os: Win7 x64 No problems on Win8 (IE 10.0) Can somebody confirm or even know why this happens? Br, UEZ
×
×
  • Create New...