04-20-2018, 08:41 AM
Macro dialog web browser open link in new dialog etc
Shift+click a link to test.
str dd=
;BEGIN DIALOG
;0 "" 0x90CF0AC8 0x0 0 0 586 262 "bs"
;2 Button 0x54030000 0x4 376 236 48 14 "Cancel"
;1 Button 0x54030001 0x4 308 236 48 14 "OK"
;3 ActiveX 0x54030000 0x0 12 8 344 216 "SHDocVw.WebBrowser {8856F961-340A-11D0-A96B-00C04FD705A2}"
;4 ActiveX 0x54030000 0x0 364 8 218 216 "SHDocVw.WebBrowser {8856F961-340A-11D0-A96B-00C04FD705A2}"
;END DIALOG
;DIALOG EDITOR: "" 0x2040701 "*" "" "" ""
str controls = "3 4"
str ax3SHD ax4SHD
if(!ShowDialog(dd &sub.DlgProc &controls)) ret
#sub DlgProc
function# hDlg message wParam lParam
SHDocVw.WebBrowser we3
int- t_mainDlg
sel message
,case WM_INITDIALOG
,t_mainDlg=hDlg
,DT_SetAutoSizeControls(hDlg "3s 4mh 4sv 1m 2m")
,max hDlg
,
,we3._getcontrol(id(3 hDlg))
,we3._setevents("sub.we3")
,
,we3.Navigate("www.google.com")
,
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
ret 1
#sub we3_NewWindow3
function IDispatch&ppDisp @&Cancel dwFlags BSTR'bstrUrlContext BSTR'bstrUrl SHDocVw.IWebBrowser2'we3
;out bstrUrl
;out bstrUrlContext
int- t_mainDlg
sel ListDialog("1 Main control[]2 Another control[]3 New dialog[]4 Web Browser" "Where to open the link?" "" 2 t_mainDlg)
,case 0
,Cancel=1
,
,case 1
,Cancel=1
,we3.Navigate(bstrUrl)
,
,case 2
,SHDocVw.WebBrowser we4._getcontrol(id(4 t_mainDlg))
,ppDisp=we4
,
,case 3
,int hDlg2=sub.Dialog2(t_mainDlg)
,SHDocVw.WebBrowser d2_we3._getcontrol(id(3 hDlg2))
,ppDisp=d2_we3
#sub Dialog2
function# [hwndOwner]
str dd=
;BEGIN DIALOG
;0 "" 0x90CF0AC8 0x0 0 0 344 214 "Dialog2"
;3 ActiveX 0x54030000 0x0 0 0 344 214 "SHDocVw.WebBrowser {8856F961-340A-11D0-A96B-00C04FD705A2}"
;END DIALOG
;DIALOG EDITOR: "" 0x2040701 "*" "" "" ""
str controls = "3"
str ax3SHD
ret ShowDialog(dd &sub.DlgProc2 &controls hwndOwner 1) ;;modeless dialog
#sub DlgProc2
function# hDlg message wParam lParam
sel message
,case WM_INITDIALOG
,DT_SetAutoSizeControls hDlg "3s"
,
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
ret 1
Shift+click a link to test.