Page 2 of 5

Re: HMG with Edge WebView2

Posted: Wed Aug 18, 2021 2:03 pm
by srvet_claudio
Hi Jimmy,
the example is created to use the compiler version of mingw that comes with hmg.3.5

Re: HMG with Edge WebView2

Posted: Wed Aug 18, 2021 3:09 pm
by Claudio Ricardo
Hola Claudio... Se ve genial !!!
Para probarlo tendré que crear una nueva VirtualBox machine con W10 y HMG 3.5 ?
o instalando HMG 3.5 para compilar y solo instalando Edge en W7 se podrá ejecutar ?
Aclaro: Uso Linux y en VirtualBox W7 HP x64 SP1 para programar y aún sigo con HMG 3.4.4

Re: HMG with Edge WebView2

Posted: Wed Aug 18, 2021 3:47 pm
by srvet_claudio
Hola Claudio,
Tenes que instalar hmg.3.5 y solo el runtime webview2 de este enlace:
https://go.microsoft.com/fwlink/p/?LinkId=2124703

No necesitas instalar el navegador Edge.

Re: HMG with Edge WebView2

Posted: Wed Aug 18, 2021 4:28 pm
by Claudio Ricardo
Ohhh buenisimo !!! sólo espero que al instalar HMG 3.5 no me haga conflicto con la versión anterior que tengo, y puedan convivir
juntas, ya que estoy desarrollando un programa grande en este momento y no quiero arriesgar.

Re: HMG with Edge WebView2

Posted: Thu Aug 19, 2021 2:40 am
by AUGE_OHR
hi Claudio,
srvet_claudio wrote: Wed Aug 18, 2021 2:03 pm the example is created to use the compiler version of mingw that comes with hmg.3.5
YES ... now i can compile / link Sample :D

have test it under Windows 11 (Insider) Version 10.0.22000.132
HMG35_WebView2.jpg
HMG35_WebView2.jpg (86.36 KiB) Viewed 3246 times
p.s. i wrote this "in" HMG_Webview2

Re: HMG with Edge WebView2

Posted: Thu Aug 19, 2021 5:34 am
by AUGE_OHR
hi,

i have play with HMG_Webview2 and add TEXTBOX to input URL
webview2_TEXTBOX.zip
(4.5 KiB) Downloaded 210 times
! Note : i have extract "C"-Code which are in HB_FUNC.PRG now
my CLICK will not try to "format" "C"-Code in HB_FUNC.PRG

now i want to learn "more" what i can do with Webview2 ...

---

some Question :

as i need "full"-String like "http://www.hmgforum.com" i check for "http" or "https"

Code: Select all

PROCEDURE DoNavigate()
LOCAL cNewURL :=  GetProperty( "Win_1", "Text_Navigate","VALUE")

   IF .NOT. "http://" $ LOWER(cNewURL) .OR. .NOT. "https://" $ LOWER(cNewURL)
      cNewURL := "https://" + cNewURL
   ENDIF

   SbarText(cNewURL) // Statusbar only in Fullscreen ?
   NAVIGATE_WEBVIEW2( cNewURL )
Return
now i use "https" ...

---

i can use Mouse-"Navigation"-Button to goto "last" or "next" Website

how can i get "active" URL to show it in Statusbar :?:

---

to check Input Webview2 use "local" Language. how can i set it to "English" :?:

---

Webview2 start with 100 % ... i like to change it to 120 % , how :?:

---

i have to use build_test_webview2.bat
can somebody please help me to build a *.HBP / *.HBC so i can use HMG35 IDE. thx

Re: HMG with Edge WebView2

Posted: Thu Aug 19, 2021 1:42 pm
by mol
I have a problem:

Code: Select all


hbmk2: Error: Referenced, missing, but unknown function(s):
       NAVIGATE_WEBVIEW2(), EXECUTESCRIPT_WEBVIEW2(), GETVERSION_WEBVIEW2(),
       INIT_WEBVIEW2(), RESIZE_WEBVIEW2()
       
how can I solve it?

Re: HMG with Edge WebView2

Posted: Thu Aug 19, 2021 3:46 pm
by AUGE_OHR
hi Mol,
mol wrote: Thu Aug 19, 2021 1:42 pm how can I solve it?
do you use my modify Version with TEXTBOX for URL Input :?:

if Yes : as i wrote i have "split" "C"-Code into HB_FUNC.PRG
than you need my modify build_test_webview2.bat

Code: Select all

call build_cpp.bat  test_webview2.prg HB_FUNC.PRG -L./WebView2/Win32 -lWebView2Loader -I./WebView2/include

Re: HMG with Edge WebView2

Posted: Thu Aug 19, 2021 7:26 pm
by andyglezl
srvet_claudio wrote: Wed Aug 18, 2021 12:17 am Hi,
this is a slightly improved version with more information to detect and solve errors in webview2 runtime.

Hola a todos, tengo algunas dudas, quizá alguno sepa...
Cree una ventana para tener el WhatsApp pero no logro que inicie el "Zoom" a un cierto valor.
Ya modifiqué la configuración de EDGE pero ni así.

Tengo que Oprimir las teclas Ctrl-"+" y Ctrl-"-" (o Ctrl-Scroll Mouse) para agrandar o
reducir el tamaño pero antes debo darle "Click" a la ventana como para "activarla"
*--------------------------------------------------------------------------------------------------------------------------
Hello everyone, I have some doubts, maybe someone knows ...
I created a window to have the WhatsApp but I can't get it to start the "Zoom" at a certain value.
I already modified the EDGE settings but not like that.

I have to press the keys Ctrl - "+" and Ctrl - "-" (or Ctrl-Scroll Mouse) to enlarge or reduce the size
but first I must give "Click" to the window as to "activate" it


Code: Select all

FUNCTION WhatAppsWeb()
	DEFINE WINDOW Win_2 ROW 0 COL 0 WIDTH 500 HEIGHT 600 TITLE "WhatAppsWeb" NOSIZE NOMAXIMIZE CHILD TOPMOST ;
			ON INIT ( Keybd_Event( VK_TAB, .T. ) )	; // SetFocus
			ON GOTFOCUS ( Press2Keys( VK_CONTROL, VK_SUBTRACT ), Press2Keys( VK_CONTROL, VK_SUBTRACT ), Press2Keys( VK_CONTROL, VK_SUBTRACT ) )
		*
	END WINDOW
	INIT_WEBVIEW2( Win_2.Handle, "https://web.whatsapp.com/" )
	CENTER WINDOW Win_2
    ACTIVATE WINDOW Win_2
RETURN
FUNCTION Press2Keys( nVK1, nVK2 )
	Keybd_Event( nVK1, .F. )
	Keybd_Event( nVK2, .F. )
	Keybd_Event( nVK2, .T. )
	Keybd_Event( nVK1, .T. )
RETURN nil
imagen_2021-08-19_140755.png
imagen_2021-08-19_140755.png (1.37 MiB) Viewed 3502 times


Y al seleccionar otro Link de la ventana principal, lo incrusta el la ventana
del WhatsApps ???
*---------------------------------------------------------------------------------------------
And when selecting another Link from the main window, it embeds it in the window
from WhatsApps ???

imagen_2021-08-19_144252.png
imagen_2021-08-19_144252.png (1.17 MiB) Viewed 3502 times


Si lo hago de otra forma, lo despliega en la ventana principal...
*-------------------------------------------------------------------------------
If I do it in another way, it displays it in the main window ...


*INIT_WEBVIEW2( Win_2.Handle, "https://web.whatsapp.com/" )
NAVIGATE_WEBVIEW2( "https://web.whatsapp.com/" )

imagen_2021-08-19_145335.png
imagen_2021-08-19_145335.png (171.75 KiB) Viewed 3502 times

Re: HMG with Edge WebView2

Posted: Thu Aug 19, 2021 9:16 pm
by srvet_claudio
Hi,
see this demo (enabled context menu, zoom, get url, devtools, etc)