HMG with Edge WebView2

HMG Samples and Enhancements

Moderator: Rathinagiri

User avatar
andyglezl
Posts: 1461
Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Contact:

Re: HMG with Edge WebView2

Post 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 3515 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 3515 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 3515 times
Andrés González López
Desde Guadalajara, Jalisco. México.
User avatar
srvet_claudio
Posts: 2223
Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Contact:

Re: HMG with Edge WebView2

Post by srvet_claudio »

Hi,
see this demo (enabled context menu, zoom, get url, devtools, etc)
Attachments
hmg_webview2_version03.zip
(2.08 MiB) Downloaded 325 times
Best regards.
Dr. Claudio Soto
(from Uruguay)
http://srvet.blogspot.com
User avatar
mol
Posts: 3805
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: HMG with Edge WebView2

Post by mol »

I've compiled and ran application.
But I'm still thinking for what we can use it?
User avatar
andyglezl
Posts: 1461
Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Contact:

Re: HMG with Edge WebView2

Post by andyglezl »

srvet_claudio wrote: Thu Aug 19, 2021 9:16 pm Hi,
see this demo (enabled context menu, zoom, get url, devtools, etc)
Gracias de nuevo.

Dr. Soto, en que parte viene lo de Zoom ?
Andrés González López
Desde Guadalajara, Jalisco. México.
User avatar
srvet_claudio
Posts: 2223
Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Contact:

Re: HMG with Edge WebView2

Post by srvet_claudio »

Hola Andrés,
El zoom con Ctrl + y Ctrl -
Best regards.
Dr. Claudio Soto
(from Uruguay)
http://srvet.blogspot.com
User avatar
srvet_claudio
Posts: 2223
Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Contact:

Re: HMG with Edge WebView2

Post by srvet_claudio »

mol wrote: Thu Aug 19, 2021 9:35 pm I've compiled and ran application.
But I'm still thinking for what we can use it?
Hi Marek,
It can be another alternative to create portable applications for desktop-mobile.
The whole GUI interface in html/css/javascript and the file/database reading/writing part in C ++ (desktop) and in Java (Android).
Best regards.
Dr. Claudio Soto
(from Uruguay)
http://srvet.blogspot.com
User avatar
andyglezl
Posts: 1461
Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Contact:

Re: HMG with Edge WebView2

Post by andyglezl »

Dr. Soto, se puede tener acceso a lo siguiente ?

COREWEBVIEW2_PERMISSION_KIND
Values Descriptions
COREWEBVIEW2_PERMISSION_KIND_UNKNOWN_PERMISSION Indicates an unknown permission.
COREWEBVIEW2_PERMISSION_KIND_MICROPHONE Indicates permission to capture audio.
COREWEBVIEW2_PERMISSION_KIND_CAMERA Indicates permission to capture video.
COREWEBVIEW2_PERMISSION_KIND_GEOLOCATION Indicates permission to access geolocation.
COREWEBVIEW2_PERMISSION_KIND_NOTIFICATIONS Indicates permission to send web notifications.
COREWEBVIEW2_PERMISSION_KIND_OTHER_SENSORS Indicates permission to access generic sensor.
COREWEBVIEW2_PERMISSION_KIND_CLIPBOARD_READ Indicates permission to read the system clipboard without a user gesture.
Andrés González López
Desde Guadalajara, Jalisco. México.
User avatar
AUGE_OHR
Posts: 2096
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: HMG with Edge WebView2

Post by AUGE_OHR »

andyglezl wrote: Thu Aug 19, 2021 7:26 pm And when selecting another Link from the main window, it embeds it in the window
from WhatsApps ???

If I do it in another way, it displays it in the main window ...

Code: Select all

	*INIT_WEBVIEW2( Win_2.Handle, "https://web.whatsapp.com/" )
	NAVIGATE_WEBVIEW2( "https://web.whatsapp.com/" )
every time you use INIT_WEBVIEW2 it will create a new Instance

i recommend to use a "PANEL" for Win_2
have fun
Jimmy
User avatar
andyglezl
Posts: 1461
Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Contact:

Re: HMG with Edge WebView2

Post by andyglezl »

AUGE_OHR wrote: Fri Aug 20, 2021 5:11 am
andyglezl wrote: Thu Aug 19, 2021 7:26 pm And when selecting another Link from the main window, it embeds it in the window
from WhatsApps ???

If I do it in another way, it displays it in the main window ...

Code: Select all

	*INIT_WEBVIEW2( Win_2.Handle, "https://web.whatsapp.com/" )
	NAVIGATE_WEBVIEW2( "https://web.whatsapp.com/" )
every time you use INIT_WEBVIEW2 it will create a new Instance

i recommend to use a "PANEL" for Win_2
Sucede lo mismo...
*---------------------------------
The same thing happens ...
Andrés González López
Desde Guadalajara, Jalisco. México.
User avatar
mol
Posts: 3805
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: HMG with Edge WebView2

Post by mol »

Can somebody put sample how to create textbox to input values and grid to display tables with WebView?
Post Reply