Jump to content

Recommended Posts

Posted

I couldn't hesitate (my wife had other plans anyway).

To check:
Just download and install the WebView2 Runtime: Evergreen Bootstrapper.
And run WebView2.au3 from Examples.
And it works !!!
Good job @LarsJ .. as always :)

 

image.png.8bca488f2d2a048a1e05cd83eaefddc8.png

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted

@TheDcoder why are you so sour ? because of my wife ? ;)

 

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted

I notice that using:

#AutoIt3Wrapper_UseX64=n

It works too.

Question: @LarsJ do we must install any additional software or you just directly use attached WebView2Loader-x64.dll and WebView2Loader-x86.dll ?

 

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted (edited)

@LarsJ do you agree that we should think like this would be a new version/replacement  for IE.au3 UDF ?

Could you confirm that this part:

_WinAPI_CoInitialize( $COINIT_APARTMENTTHREADED )

    CoreWebView2CreateCoreWebView2EnvironmentCompletedHandlerCreate()
    ConsoleWrite( "$pCoreWebView2CreateCoreWebView2EnvironmentCompletedHandler = " & $pCoreWebView2CreateCoreWebView2EnvironmentCompletedHandler & @CRLF & @CRLF )

    CoreWebView2CreateCoreWebView2ControllerCompletedHandlerCreate()
    ConsoleWrite( "$pCoreWebView2CreateCoreWebView2ControllerCompletedHandler = " & $pCoreWebView2CreateCoreWebView2ControllerCompletedHandler & @CRLF & @CRLF )

    Local $hWebView2Loader = DllOpen( @AutoItX64 ? "WebView2Loader-x64.dll" : "WebView2Loader-x86.dll" )
    Local $aRet = DllCall( $hWebView2Loader, "long", "CreateCoreWebView2EnvironmentWithOptions", "wstr", "", "wstr", "", _
                           "ptr", NULL, "ptr", $pCoreWebView2CreateCoreWebView2EnvironmentCompletedHandler )
    If @error Or $aRet[0] Then Return ConsoleWrite( "CreateCoreWebView2EnvironmentWithOptions ERR" & @CRLF )
    ConsoleWrite( "CreateCoreWebView2EnvironmentWithOptions OK" & @CRLF & @CRLF )

is a replacement for _IECreate() ?

We should start with something that will be familiar, could you provide 1 other basic replacement for _IENavigate() ?
Than I think all interested in contribution/involvment (like me)  could start to create other/next IE functions replacment.

Edited by mLipok

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted

Opening post suplemented:

  On 11/12/2020 at 10:43 AM, mLipok said:

TIMELINE/ChangeLog:

  1. 2020-11-12 - Project propsed by @mLipok
  2. 2021-02-03 - First version provided by @LarsJ
Expand  

 

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted
  On 2/3/2021 at 9:43 PM, ptrex said:

Here no go  so far :  "CreateCoreWebView2EnvironmentWithOptions ERR"

Expand  

This error is most likely due to a version of Microsoft Edge based on the Chromium code or the WebView2 runtime code not installed.

Posted

This what Edge says :

Microsoft Edge is up to date.Version 88.0.705.56 (Official build) (64-bit)

This is what I installed as runtime : WebView2 Runtime: Evergreen Bootstrapper.

MicrosoftEdgeWebview2Setup x64 bit

Not sure what else needs to be installed are prerequisite ?

Posted (edited)

same as @ptrex .....

I tried it on 3 different computers even after installing "WebView2 Runtime: Evergreen Bootstrapper" but still nothing. There is some detail that escapes us.

Are there any other "beta testers" who have tried this?

p.s.
..... Come on, @LarsJ and @mLipok, what other secret setting did you use !!??  ..... :D

Edited by Chimp

 

image.jpeg.9f1a974c98e9f77d824b358729b089b0.jpeg Chimp

small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....

Posted (edited)
  On 2/4/2021 at 9:26 AM, Chimp said:

.... Come on, @LarsJ and @mLipok, what other secret setting did you use !!??  ..... :D

Expand  

magic..... 🤐

But seriously, currently I'm at my office. Checked here, I have the same problem.
I will see what I can do.

  Quote

CoreWebView2CreateCoreWebView2EnvironmentCompletedHandler_AddRef

CoreWebView2CreateCoreWebView2EnvironmentCompletedHandler_Release

CreateCoreWebView2EnvironmentWithOptions ERR
+>11:37:44 AutoIt3.exe ended.rc:0
+>11:37:44 AutoIt3Wrapper Finished.
>Exit code: 0    Time: 1.802

Expand  

 

Edited by mLipok

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted

I just download and install

https://developer.microsoft.com/en-US/microsoft-edge/webview2/#download-section

image.png.ce805dbf72c7e3d57685b0877bdf3f71.png

 

And try again using @LarsJ script, and now all is working fine.

 

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted (edited)

@mLipok

That is exactly what I had installed yesterday, 

The link to the error refers to a missing folder that needs to exist for the WebView2 to operate in.

https://docs.microsoft.com/en-us/microsoft-edge/webview2/reference/win32/webview2-idl?view=webview2-1.0.705.50#createcorewebview2environmentwithoptions

If it does not find that folder it will not start. 

Simular issues reported here

https://www.autohotkey.com/boards/viewtopic.php?t=81354

not sure what was the fix though ... has to do with versioning ...

Edited by ptrex
Posted

I've followed the Getting started with WebView2 example. According to Prerequisites, I've installed the Microsoft Edge Chromium version and the WebView2 Runtime (Evergreen Bootstrapper). But I haven't installed a Beta/Dev/Canary version of Microsoft Edge. You could try to install e.g. the Beta version. In the AutoHotkey posts there are examples that this has been necessary.

I'm on Windows 10 update 1909. These are the relevant folders in C:\Program Files (x86)\Microsoft:

C:\Program Files (x86)\Microsoft\Edge
C:\Program Files (x86)\Microsoft\Edge\Application
C:\Program Files (x86)\Microsoft\Edge\Application\88.0.705.56

C:\Program Files (x86)\Microsoft\EdgeUpdate
C:\Program Files (x86)\Microsoft\EdgeUpdate\1.3.139.71

C:\Program Files (x86)\Microsoft\EdgeWebView
C:\Program Files (x86)\Microsoft\EdgeWebView\Application
C:\Program Files (x86)\Microsoft\EdgeWebView\Application\88.0.705.56

 

Posted

On Win10 version 2004 ( my PC ), it works after installing MicrosoftEdgeWebView2RuntimeInstallerX64.exe
We would have to see how far back ( for Larsj works on version 1909 ), this tech. works.
Unfortunately "Edition: Win 10" don't say much without "Version: xxxx", just as in WinXP was not the same in SP1 as in SP2, or Win98SE, etc. .

So do report your environment ( Edition and Version/Update ) when reporting about it.

Follow the link to my code contribution ( and other things too ).
FAQ - Please Read Before Posting.
autoit_scripter_blue_userbar.png

Posted (edited)

Hi guys,

All works fine 🙂

The reason is just a matter of telling the application where to look for the DLL.

Solution :

I found the it here : 

https://www.codeproject.com/Tips/5287858/WebView2-Edge-Browser-in-MFC-Cplusplus-Application

 

What to do, if Build is successful and when you run, it fails.

Open the project in the file system, there is one debug folder (which is created once the build is successful). In the debug folder, there are three different folders - arm64, x64, x86 and each one contains the file "WebView2Loader.dll".

So based on your environment, copy the "WebView2Loader.dll" file and paste where your .exe is located.

Root cause :

When you run the script in SciTE, it does not find the DLL because it is ran from the AutoIT folder...

When you compile the script and put is in the .EXE same folder as the DLL all runs fine ...

Check :

Once you have ran it, it will create a new folder and a bunch of sub folders and files :

Main Folder is called WebView2.exe.WebView2

 

Great job LarsJ  👌

Edited by ptrex
Posted (edited)

I just do a quick resarch. In WebView2.au3 put MsgBox and Navigate after GUISetState()

GUISetState( @SW_SHOW )

    MsgBox(0, '', @ScriptLineNumber)
    $oCoreWebView2.Navigate( "https://www.autoitscript.com/forum/topic/204362-microsoft-edge-webview2-embed-web-code-in-your-native-application/" )
    Sleep(2000)
    $oCoreWebView2.OpenDevToolsWindow()

 

image.thumb.png.c7ef55726d016ede7b07bd69d2f01f33.png

Edited by mLipok

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted
  On 2/4/2021 at 2:27 PM, ptrex said:

... The reason is just a matter of telling the application where to look for the DLL ...

Expand  

Hi @ptrex and thanks for the tips
I was only able to run this script when it was compiled.
You talk about the library "WebView2Loader.dll", but I have not found a trace. I guess we need to refer to the WebView2Loader-x64.dll or WebView2Loader-x86.dll libraries instead.
But where should I put these libraries to be able to run the script from SciTE without having to compile it every time I make a change?
I also tried to indicate in the script the full path of these libraries instead of just the file name, but it didn't help ...
Thanks again for any tip

 

image.jpeg.9f1a974c98e9f77d824b358729b089b0.jpeg Chimp

small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....

Posted

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...