Page 4 of 5

Re: HMG with Edge WebView2

Posted: Fri Aug 20, 2021 6:23 am
by AUGE_OHR
andyglezl wrote: Fri Aug 20, 2021 5:24 am Sucede lo mismo...
*---------------------------------
The same thing happens ...
have a look at my Sample how i place TEXTBOX and PANEL for Webview2
http://www.hmgforum.com/viewtopic.php?f ... 2&start=12

Re: HMG with Edge WebView2

Posted: Fri Aug 20, 2021 6:25 am
by AUGE_OHR
hi,

when i use

Code: Select all

HB_FUNC( NAVIGATE_WEBVIEW2 )
i want to know if it was successful .T. or not .F.

so how to modify "C"-Code :?:

---

i use

Code: Select all

HB_FUNC( GETSOURCE_WEBVIEW2 )
after NAVIGATE_WEBVIEW2 ... is this the right place :?:

Re: HMG with Edge WebView2

Posted: Fri Aug 20, 2021 8:24 am
by AUGE_OHR
hi,

after "navigate" to some Website i saw this in Taskmanager
Many_WV2.jpg
Many_WV2.jpg (206.25 KiB) Viewed 2937 times
so how to "release" all those Connection :idea:

Re: HMG with Edge WebView2

Posted: Fri Aug 20, 2021 8:00 pm
by ASESORMIX
Estimado Sr Soto:
Muchas Gracias por compartir sus investigaciones y conocimientos con nosotros.
Esto es muy valioso para este Foro. Carece de limites su gran ayuda.

Re: HMG with Edge WebView2

Posted: Fri Aug 20, 2021 8:12 pm
by andyglezl
Hola Dr. Soto
Guiado por la lógica...
No debería de crearse y cargarse una página en cada ventana !!!
Porque en todas me deja la última "http://www.hmgforum.com" ???
*----------------------------------------------------------------------------------
Hello Dr. Soto
Guided by logic ...
Shouldn't a page be created and loaded in every window !!!
Because in all of them he leaves me the last "http://www.hmgforum.com" ???


Gracias por su tiempo !

Code: Select all

		*-----------------------------------------------------------------------------------------------------
		@ 000 , nWWidth-20 BUTTON WhatsApp2 OF Win_1 CAPTION "↹" WIDTH 20 HEIGHT 30 FONT "Verdana" SIZE 16  ;
							ACTION AbreCierra( "Win_2" ) TOOLTIP "Cierra/Abre Ventana de WHATSAPP" FLAT					
		DEFINE WINDOW Win_2 ROW 000 COL nWWidth-670 WIDTH 650 HEIGHT nWHeight-60 PANEL BACKCOLOR GRAY 
			INIT_WEBVIEW2( Win_2.Handle, "https://web.whatsapp.com/" )
		END WINDOW
		*-----------------------------------------------------------------------------------------------------
		@ 025 , nWWidth-20 BUTTON WhatsApp3 OF Win_1 CAPTION "↹" WIDTH 20 HEIGHT 30 FONT "Verdana" SIZE 16 	;
							ACTION AbreCierra( "Win_3" ) TOOLTIP "Cierra/Abre Ventana de FILETRANSFER" FLAT
		DEFINE WINDOW Win_3 ROW 000 COL nWWidth-670 WIDTH 650 HEIGHT nWHeight-60 PANEL BACKCOLOR GRAY 
			INIT_WEBVIEW2( Win_3.Handle, "chrome-extension://kpadbdhpogbhpiklfcbdjdjgmehajcgf/index.html" )
		END WINDOW
		*-----------------------------------------------------------------------------------------------------
		@ 050 , nWWidth-20 BUTTON WhatsApp4 OF Win_1 CAPTION "↹" WIDTH 20 HEIGHT 30 FONT "Verdana" SIZE 16  ;
							ACTION AbreCierra( "Win_4" ) TOOLTIP "Cierra/Abre Ventana de HMGFORUM" FLAT
		DEFINE WINDOW Win_4 ROW 000 COL nWWidth-670 WIDTH 650 HEIGHT nWHeight-60 PANEL BACKCOLOR GRAY 
			INIT_WEBVIEW2( Win_4.Handle, "http://www.hmgforum.com" )
		END WINDOW
		*-----------------------------------------------------------------------------------------------------
imagen_2021-08-20_150638.png
imagen_2021-08-20_150638.png (114 KiB) Viewed 2909 times

Re: HMG with Edge WebView2

Posted: Sat Aug 21, 2021 4:33 am
by AUGE_OHR
AUGE_OHR wrote: Fri Aug 20, 2021 8:24 am Many_WV2.jpg
so how to "release" all those Connection :idea:
i recognize that EDGE Browse does same ... so it is normal.

---

i try to crate *.HBP / *.HBC

Code: Select all

*.HBP

test_webview2.prg
HB_FUNC.PRG

Code: Select all

*.HBC

libpaths=.\WebView2\Win32 
incpaths=.\WebView2\include
libs=WebView2Loader 
but i got this Error :(
Harbour 3.2.0dev (r2011030937)
Copyright (c) 1999-2020, https://harbour.github.io/
In file included from C:\HMG.3.5\2\hmg_webview2\HB_FUNC.PRG:13:
C:/HMG.3.5/2/hmg_webview2/WebView2/include/WebView2.h:19: warning: ignoring #pragma warning [-Wunknown-pragmas]
19 | #pragma warning( disable: 4049 ) /* more than 64k source lines */
|
C:\HMG.3.5\2\hmg_webview2\HB_FUNC.PRG:14:10: fatal error: functional: No such file or directory
14 | #include <functional>
| ^~~~~~~~~~~~
compilation terminated.
hbmk2[HBWWB]: Error: Running C/C++ compiler. 1
gcc.exe -c -O3 -march=i586 -mtune=pentiumpro -fomit-frame-pointer -W -Wall -pipe -IC:/HMG.3.5/harbour/include -IC:/HMG.3.5/2/hmg_webview2 -IC:/HMG.3.5/include -IC:/HMG.3.5/2/hmg_webview2/WebView2/include R:/Temp/hbmk_rkjw3n.dir/test_webview2.c R:/Temp/hbmk_rkjw3n.dir/HB_FUNC.c R:/Temp/hbmk_r40kbw.c
can someone help me please ... what i´m doing wrong :?:

Re: HMG with Edge WebView2

Posted: Sat Aug 21, 2021 8:48 am
by AUGE_OHR
hi,

i found
put_ZoomFactor

Sets the ZoomFactor property.

Code: Select all

public HRESULT put_ZoomFactor(double zoomFactor)
https://docs.microsoft.com/en-us/micros ... zoomfactor

it does use ICoreWebView2Controller interface which is already working
so it should be "easy" for a "C"-Programmer to build a HB_FUNC to set Property of Zoom ... ;)

---

i´m not a "C"-Programmer so excuse my Question

Code: Select all

HB_FUNC( NAVIGATE_WEBVIEW2 )
{
   WCHAR * szURL = HMG_CHAR_TO_WCHAR( hb_parc( 1 ) );
   if( isReady )
      webview2->lpVtbl->Navigate( webview2, szURL );
}
how to enhance that HB_FUNC and return a ( numerric ) Value :idea:

Re: HMG with Edge WebView2

Posted: Sun Aug 22, 2021 1:54 am
by AUGE_OHR
hi,
andyglezl wrote: Thu Aug 19, 2021 7:26 pm 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
is there a Trick "how" to simulate "click" so WebView2 have "Focus" :?:

Re: HMG with Edge WebView2

Posted: Sun Aug 22, 2021 7:09 am
by AUGE_OHR
hi,

i try to "setfocus" to Webvuew2 this Way

Code: Select all

      Domethod( cForm, "setfocus" )
      HwndWin := FindWindowEx( GetFormHandle( cForm ), 0, "Chrome_WidgetWin_0", 0 )
      IF ! EMPTY(HwndWin)
         MsgDebug(HwndWin0,"Chrome_WidgetWin_0")
         HMG_Calldll( "User32.dll", , "setfocus", HwndWin ,0 )

         nHwnd := FindWindowEx( HwndWin0, 0, "Chrome_WidgetWin_1", 0 )
         IF ! EMPTY(nHwnd)
            MsgDebug(nHwnd,"Chrome_WidgetWin_1")
            HMG_Calldll( "User32.dll", , "setfocus", nHwnd ,0)

            nRender := FindWindowEx( nHwnd, 0, "Chrome_RenderWidgetHostHWND", 0 )
            IF ! EMPTY(nRender)
               MsgDebug(nRender,"Chrome_RenderWidgetHostHWND")
               HMG_Calldll( "User32.dll", , "setfocus", nRender ,0)
you will see all MsgDebug but i still get no focus "to Webview" so it does not react on Cursor up/down
i have to "click" into Webview2 Sample ... how to simulate "click" :idea:

Re: HMG with Edge WebView2

Posted: Thu Aug 26, 2021 5:55 pm
by andyglezl
Hola a todos

He estado "jugando" con esta opción que nos ha dejado el Dr. Soto
y veo grandes posibilidades de hacer muchas cosas.

Aquí les dejo una "Demo", que la disfruten !

P.D. Recuerden modificar el archivo Build_cpp.bat con el Path
donde tengan HMG 3.5
*----------------------------------------------------------------------------------
Hi everyone

I have been "playing" with this option that Dr. Soto has left us
and I see great possibilities to do many things.

Here he left you a "Demo", enjoy it!

P.S. Remember to modify the Build_cpp.bat file with the Path
where they have HMG 3.5


Hmg-Webview2.zip
(2.12 MiB) Downloaded 429 times
imagen_2021-08-26_124734.png
imagen_2021-08-26_124734.png (303.47 KiB) Viewed 2648 times
imagen_2021-08-26_134149.png
imagen_2021-08-26_134149.png (465.96 KiB) Viewed 2637 times
imagen_2021-08-26_132914.png
imagen_2021-08-26_132914.png (1.31 MiB) Viewed 2639 times
imagen_2021-08-26_134405.png
imagen_2021-08-26_134405.png (197.05 KiB) Viewed 2637 times
imagen_2021-08-26_134504.png
imagen_2021-08-26_134504.png (40.73 KiB) Viewed 2637 times
imagen_2021-08-26_134534.png
imagen_2021-08-26_134534.png (159.87 KiB) Viewed 2637 times
imagen_2021-08-26_134726.png
imagen_2021-08-26_134726.png (17 KiB) Viewed 2637 times