Date: 02-16-2022
Return to Index
created by gbSnippets
'Compilable Example: (Jose Includes)
#Compile Exe
#Dim All
%Unicode = 1
%UseWebBrowser = 1 ' // Use the WebBrowser control
#Include Once "CWindow.inc" ' // CWindow class
%IDC_WebBrowser = 1001
%IDC_Back = 1002
%IDC_Forward = 1003
Global hDlg, hBrowser As Dword
Function PBMain
Local pWindow As IWindow
Dialog New Pixels, 0, "WebBrowser",0, 40, 600, 400, %WS_OverlappedWindow To hDlg
Control Add Button, hDlg, %IDC_Back, "Back", 10,10,50,25
Control Add Button, hDlg, %IDC_Forward, "Forward", 110,10,50,25
pWindow = Class "CWindow"
hBrowser = pWindow.AddWebBrowserControl(hDlg, %IDC_WEBBROWSER, "http://www.garybeene.com", Nothing, 0, 40, 600,400)
Dialog Show Modal hDlg, Call DlgProc
End Function
CallBack Function DlgProc() As Long
Local pIWebBrowser2 As IWebBrowser2
Select Case Cb.Msg
Case %WM_Command
Select Case Cb.Ctl
Case %IDC_Back
pIWebBrowser2 = OC_GetDispatch(hBrowser)
pIWebBrowser2.GoBack
Case %IDC_Forward
pIWebBrowser2 = OC_GetDispatch(hBrowser)
pIWebBrowser2.GoForward
End Select
End Select
End Function
'gbs_01325
'Date: 05-11-2013
http://www.garybeene.com/sw/gbsnippets.htm