Recently Browsing 0 members
No registered users viewing this page.
Anybody could help with using QueryInterface in AutoIt to embed Microsoft Edge using WebView2 Interface ?
Here are links to information/documentation:
Image comes from: https://docs.microsoft.com/en-us/microsoft-edge/webview2/media/webview2/whatwebview.png
Introduction to Microsoft Edge WebView2
Understand WebView2 SDK versions
I'm not WindowsApi expert (QueryInterface, C++, DllCall).
What I trying to say is: It means that I do not done anything in this regards .... as so far.
2020-11-12 - Project propsed by @mLipok 2021-02-03 - First version provided by @LarsJ
Recently I start wd_capabilities.au3 project on my side.
I think this is time to share to AutoIt community.
Check attached UDF: wd_capabilities.au3
Here is a scratch example showing how to use them:
#include "wd_helper.au3" #include "wd_capabilities.au3" _Example() Func _Example() ........ ........ ........ _WD_Capabilities_Build_Arguments(Null) ; CLEANUP ARGS _WD_Capabilities_Build_Arguments('--headless') _WD_Capabilities_Build_Arguments('start-maximized') _WD_Capabilities_Build_Arguments('disable-infobars') _WD_Capabilities_Build_Arguments('user-data-dir', 'C:\Users\' & @UserName & '\AppData\Local\Google\Chrome\User Data\Default') Local $s_WD_Capabilities_Arguments = _WD_Capabilities_Build_Arguments(Default) ; GET ARGS _WD_Capabilities_Build_Preferences(Null) ; CLEANUP PREFS If $s_Download_dir Then _WD_Capabilities_Build_Preferences('download.default_directory', $s_Download_dir) Local $s_WD_Capabilities_Preferences = _WD_Capabilities_Build_Preferences(Default) ; GET PREFS Local $s_Desired_Capabilities = _WD_Capabilities_Build_JSON('chrome', $s_WD_Capabilities_Arguments, $s_WD_Capabilities_Preferences) Local $WD_SESSION = _WD_CreateSession($s_Desired_Capabilities) ........ ........ ........ EndFunc
I plan to publish the code on GitHub.
In the indefinite future, when the project becomes more functional, if @Danp2 accepts it, I hope it may be included in the main WebDriver UDF.
I am waiting for yours feedback and help in the further development of this project.
As so far this UDF only supports GoogleChrome.
Adding support for other browsers shouldn't be difficult, I just didn't need to.
For now, this project is working but still as a early BETA, so please do not discuss, ask questions, or post examples or snippets of code that pertain to any function of this UDF in other part of this forum, until it is found acceptable. Simply: discusion and tests only here in this topic.
Extensive library to control and manipulate Microsoft Outlook. This UDF holds the functions to automate items (folders, mails, contacts ...) in the background. Can be seen like an API.
There are other UDFs available to automate Outlook:
OutlookEX_GUI: This UDF holds the functions to automate the Outlook GUI. OutlookTools: Allows to import/export contacts and events to VCF/ICS files and much more. Threads: Development - General Help & Support - Example Scripts - Wiki
BTW: If you like this UDF please click the "I like this" button. This tells me where to next put my development effort
KNOWN BUGS (last changed: 2020-02-09)
Excel VBA's IDE registers a Control-y as "cut this line of code".
For those prone to Undo/Redo (Ctrl+Z/Ctrl+Y) you may find frustration when your code in the editor does not redo, but in fact clears your active line of code while killing redo history.
Though not perfect, I keep this tool running in background on startup.
The purpose is to allow Cltr+Y to act normally throughout Windows and Office and only interact *differently* with the "Microsoft Visual Basic for Applications" window that is active.
If the Standard Menu bar exists, it'll try to click the ReDo (Blue Arrow to the right), else "Alt+e, r" keystrokes (less desired).
Here's the code:
Opt('MustDeclareVars', 1) Opt("WinTitleMatchMode", 1) HotKeySet("^y", "TriggerRedo") While 1 Sleep(10) WEnd Func TriggerRedo() ConsoleWrite("TriggerRedo()" & @CRLF) Local $title = "Microsoft Visual Basic for Applications - " Local $hWnd If WinExists($title) And WinActive($title) Then ;~ Parent Window Handle $hWnd = WinGetHandle($title) Local $aWindowPos = WinGetPos($hWnd) ;~ Control Bar Handle, Position and If Visible Local $sControlID = "[CLASS:MsoCommandBar; TEXT:Standard;]" Local $hStandardBar = ControlGetHandle($hWnd, "", $sControlID) Local $bIsVisible = ControlCommand($hWnd, "", $sControlID, "IsVisible") If $hStandardBar And $bIsVisible Then ConsoleWrite("Using Mouse Click." & @CRLF) ;~ Determine Redo button location on visible Control Bar Local $aBarPos = ControlGetPos($hWnd, "", $sControlID) Local $mX = $aWindowPos + $aBarPos + 217 + Int(23/2) Local $mY = $aWindowPos + $aBarPos + 27 + Int(22/2) MouseClick("Left", $mX, $mY, 1, 0) Else ConsoleWrite("Using VBA Send Keys." & @CRLF) $sControlID = "[CLASS:MsoCommandBar; TEXT:Menu Bar;]" Local $hMenuBar = ControlGetHandle($hWnd, "", $sControlID) ControlSend($hWnd, "", $hMenuBar, "!e") ;~ Send("r") $sControlID = "[CLASS:MsoCommandBarPopup; TEXT:Edit;]" Local $hPopupBar = ControlGetHandle($hWnd, "", $sControlID) ControlSend($hWnd, "", $hPopupBar, "r") EndIf Else ConsoleWrite("Using NATIVE Send Keys." & @CRLF) HotKeySet("^y") Send("^y") ;~ may cause "yyy..." when held HotKeySet("^y", "TriggerRedo") EndIf EndFunc ;==>TriggerRedo Hope this inspires someone.
The following code creates a IE blank window
Local $oIE = _IECreate()
But when i use Navigate to the URL, it open the URL in Microsoft Edge instead if IE.
What should i do to navigate in IE.
Complete code :
#include <MsgBoxConstants.au3> #include <WinAPIFiles.au3> #include <IE.au3> #Region TESTING Local $url = 'https://www.youtube.com' Local $oIE = _IECreate() _IENavigate($oIE,$url) #EndRegion Console Output
IE.au3 T3.0-2 Error from function _IELoadWait, $_IESTATUS_ClientDisconnected (-2147023174, Browser has been deleted prior to operation.)
I have searched the forums but did not find such kind of post.
Other posts were describing How to use Edge using Web driver selenium.
Edit: I am working in Windows10. Recently many changes have been done by Microsoft to IE and Microsoft Edge. (2020)
Earlier in 2019 this was working fine.