Hi,
The window of the WebView object creates a window. Is it possible to make the WebView open in a hidden form (without a window appearing on the screen) ?
#include "FiveWin.ch"
function Main()
local oWebKds := TWebView():New()
oWebKds := TWebView():New()
oWebKds:bOnBind = { | cJson, nCalls | MsgInfo( cJson, nCalls ) }
oWebKds:Bind( "SendKds" )
cUrl:="https://www.google.com"
buf:='function Kds_Url() { SendKds(document.body.innerHTML) } ;'+CRLF+ ;
'window.location.href="'+cUrl+'" ;'+CRLF+ ;
'Kds_Url() ;'
DEFINE DIALOG oKds FROM 0,0 TO 400,400 PIXEL ;
STYLE nOR(WS_POPUP) COLOR CLR_BLACK, CLR_WHITE
ACTIVATE DIALOG oKds ON PAINT (oWebKds:SetParent(oKds), oWebKds:Eval(buf))
return
#include "FiveWin.ch"
//----------------------------------------------------------------------------//
function Main()
local oWebView := TWebView():New()
oWebView:bOnBind = { | cJson, nCalls | MsgInfo( cJson, nCalls ) }
oWebView:Bind( "SendToFWH" )
oWebView:Navigate( Html() )
Sleep( 200 )
oWebView:Run()
oWebView:Destroy()
return nil
//----------------------------------------------------------------------------//
function Html()
local cHtml
TEXT INTO cHtml
data:text/html,
<html>
<head>
</head>
<body style="background-color:cyan">
<h2>Using WebView from FWH</h2>
<button onclick='SendToFWH( 123 )'>Call FWH app from web browser</button>
<button onclick='SendToFWH( 456 )'>Test 2</button>
<button onclick='SendToFWH( document.body.innerHTML )'>Test 3</button>
</body>
</html>
ENDTEXT
return cHtml
//----------------------------------------------------------------------------//
#include "FiveWin.ch"
//----------------------------------------------------------------------------//
function Main()
local oWebView := TWebView():New()
oWebView:bOnBind = { | cJson, nCalls | MsgInfo( cJson, nCalls ) }
oWebView:Bind( "SendToFWH" )
oWebView:Navigate( Html() )
Sleep( 200 )
oWebView:Eval( "SendToFWH( document.body.innerHTML )" )
oWebView:Run()
oWebView:Destroy()
return nil
//----------------------------------------------------------------------------//
function Html()
local cHtml
TEXT INTO cHtml
data:text/html,
<html>
<head>
</head>
<body style="background-color:cyan">
<h2>Using WebView from FWH</h2>
<button onclick='SendToFWH( 123 )'>Call FWH app from web browser</button>
<button onclick='SendToFWH( 456 )'>Test 2</button>
<button onclick='SendToFWH( document.body.innerHTML )'>Test 3</button>
</body>
</html>
ENDTEXT
return cHtml
//----------------------------------------------------------------------------//
#include "FiveWin.ch"
//----------------------------------------------------------------------------//
function Main()
local oWebView := TWebView():New()
oWebView:bOnBind = { | cJson, nCalls | MsgInfo( cJson, nCalls ) }
oWebView:Bind( "SendToFWH" )
oWebView:Navigate( "https://www.fivetechsoft.com" )
Sleep( 200 )
oWebView:Eval( "SendToFWH( document.body.innerHTML )" )
oWebView:Run()
oWebView:Destroy()
return nil
//----------------------------------------------------------------------------//
ACTIVATE DIALOG oKds ON INIT ( oWebKds:SetParent(oKds), Sleep( 300 ) ) ON PAINT ( oWebKds:Eval(buf) )
DEFINE DIALOG oDlg FROM 0,0 TO 400,400 PIXEL TRUEPIXEL RESIZABLE
#include "FiveWin.ch"
function Main()
local oWebKds := TWebView():New()
oWebKds := TWebView():New()
oWebKds:bOnBind = { | cJson, nCalls | MsgInfo( cJson, nCalls ) }
oWebKds:Bind( "SendKds" )
cUrl:="https://www.google.com"
buf:='function Kds_Url() { SendKds(document.body.innerHTML) } ;'+CRLF+ ;
'window.location.href="'+cUrl+'" ;'+CRLF+ ;
'document.addEventListener("DOMContentLoaded", Kds_Url()) ;'
DEFINE DIALOG oKds FROM 0,0 TO 400,400 PIXEL TRUEPIXEL RESIZABLE TITLE "Test"
ACTIVATE DIALOG oKds ON PAINT (sleep(200), oWebKds:Eval(buf))
return
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 27 guests