|
-
Sep 13th, 2024, 04:09 AM
#11
New Member
Re: vb6 edge webview2 demo by IUnknown?without rc6.dll
 Originally Posted by xiaoyao
add some webviewe method
Code:
Function OpenUrl(ByVal Url As String)
If Left(LCase(Url), 4) <> "http" Then Url = "http://" & Url
v = VTableCallEx("Navigate", webviewWindow, 3, StrPtr(Url))
End Function
Function OpenDevToolsWindow()
v = VTableCallEx("OpenDevToolsWindow", webviewWindow, 49)
End Function
Function ExecuteScript(JS As String)
v = VTableCallEx("ExecuteScript", webviewWindow, 27, StrPtr(JS), 0&)
End Function
Function AddHostObjectToScript(ObjName As String, Obj1 As Object)
v = VTableCallEx("AddHostObjectToScript", webviewWindow, 47, StrPtr(ObjName), ObjPtr(Obj1))
AddHostObjectToScript = hResult = 0
End Function
Function WebReSize() As Boolean
Dim RECT1 As RECT
GetClientRect webHostHwnd, RECT1
'webviewController->put_Bounds(bounds);
v = VTableCallEx("put_Bounds", webviewController, 4, RECT1.Left, RECT1.Top, RECT1.Right, RECT1.Bottom)
WebReSize = hResult = 0
End Function
HI xiaoyao,
Very nice work , your solution is very helpful .
Please help me if possible , in my case i need to get return value/result from javascript function , I tried using ExecuteScript function but no luck .
Thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|