Date: 02-16-2022
Return to Index
created by gbSnippets
'Compilable Example: (Jose Includes)
#Compile Exe
#Dim All
%Unicode = 1
%UseWebBrowser = 1 '
#Include Once "CWindow.inc" 'Jose Roca includes
%IDC_WebBrowser = 1001
%IDC_Kill = 1002
Global hDlg As Dword
Function PBMain
Local bstrURL As WString, pWindow As IWindow
Dialog New Pixels, 0, "WebBrowser Get Selected Text", , , 600, 400, %WS_OverlappedWindow To hDlg
Control Add Button, hDlg, %IDC_Kill, "Kill", 10,10,140,20
pWindow = Class "CWindow"
bstrURL = "http://www.powerbasic.com"
pWindow.AddWebBrowserControl(hDlg, %IDC_WEBBROWSER, bstrURL, Nothing, 0, 40, 600,350)
Dialog Show Modal hDlg, Call DlgProc
End Function
CallBack Function DlgProc() As Long
Select Case CbMsg
Case %WM_Command
Select Case Cb.Ctl
Case %IDC_Kill
Control Kill hDlg, %IDC_WebBrowser
Local bstrURL As WString, pWindow As IWindow
pWindow = Class "CWindow"
bstrURL = "http://www.garybeene.com"
pWindow.AddWebBrowserControl(hDlg, %IDC_WEBBROWSER, bstrURL, Nothing, 0, 40, 600,350)
End Select
Case %WM_Size
If Cb.WParam <> %Size_Minimized Then
Local w,h As Long
Dialog Get Client Cb.Hndl To w,h
Control Set Size Cb.Hndl, %IDC_WebBrowser, w, h-40
End If
End Select
End Function
'gbs_01328
'Date: 05-11-2013
http://www.garybeene.com/sw/gbsnippets.htm