using webview from Harbour

394 views
Skip to first unread message

Antonio Linares

unread,
Feb 17, 2022, 1:46:24 AM2/17/22
to Harbour Users

#include "hbdyn.ch"

function Main()

   local pLib := hb_LibLoad( "webview.dll" )
   local hWebView := hb_DynCall( { "webview_create", pLib, hb_bitOr( HB_DYN_CTYPE_VOID_PTR,;
                             hb_SysCallConv() ), HB_DYN_CTYPE_VOID_PTR,;
                             hb_SysLong(), HB_DYN_CTYPE_VOID_PTR }, 0, 0 )

   hb_DynCall( { "webview_navigate", pLib, hb_bitOr( HB_DYN_CTYPE_VOID, hb_SysCallConv() ),;
                 HB_DYN_CTYPE_VOID_PTR, HB_DYN_CTYPE_CHAR_PTR },;
                 hWebView, "http://www.google.com" )

   hb_DynCall( { "webview_run", pLib, hb_bitOr( HB_DYN_CTYPE_VOID,;
                 hb_SysCallConv() ), HB_DYN_CTYPE_VOID,;
                 HB_DYN_CTYPE_VOID_PTR }, hWebView )
   
   hb_LibFree( pLib )

return nil

function hb_SysLong()

return If( hb_OSIS64BIT(), HB_DYN_CTYPE_LLONG_UNSIGNED, HB_DYN_CTYPE_LONG_UNSIGNED )  

function hb_SysCallConv()

return If( ! "Windows" $ OS(), HB_DYN_CALLCONV_CDECL, HB_DYN_CALLCONV_STDCALL )

best regards

Antonio

Antonio Linares

unread,
Feb 17, 2022, 2:29:54 AM2/17/22
to Harbour Users

Diego Pego

unread,
Aug 15, 2023, 1:17:47 PM8/15/23
to Harbour Users
Thank you Antonio!

Antonio Linares

unread,
Aug 15, 2023, 1:36:55 PM8/15/23
to Harbour Users
We have modified webview.h so you can use it from a dialogbox and when closing it, it will not close the app

Also, we modified it to support google authentication. We have implemented several missing funcionalities:


to build it: git clone the official webview repo, replace webview.h and run c:\webview\script\build.bat

best regards

Diego Pego

unread,
Aug 16, 2023, 8:42:56 AM8/16/23
to Harbour Users
:-) good news for us! thank you!
Reply all
Reply to author
Forward
0 new messages