Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
SHDocVw.WebBrowser with tabs
#18
I would do differently. The dialog function should manage its controls, because it knows better how to do it, and because it's better to do it in its thread. External function should send a message to tell the dialog function to do it.

Function dlg_tabbed_web_browser2
Code:
Copy      Help
,case WM_APP+1
,;A macro can send this message to select a tab and load a page.
,;wParam is tab index, lParam is URL; if lParam 0, just selects tab.
,;Returns current tab index (before changing).
,;Don't send from other process.
,;EXAMPLES
,;int w=win("QM tabbed web browser" "#32770")
,;SendMessage w WM_APP+1 2 0 ;;select tab 2
,;SendMessage w WM_APP+1 1 "www.quickmacros.com" ;;select tab 1 and load URL
,
,_i=iTab
,if wParam>=0 and wParam<ta.len
,,if(wParam!=iTab) SelectTab id(3 hDlg) wParam
,,if lParam
,,,lpstr URL=+lParam
,,,wbDTWB2._getcontrol(ta[wParam].hwndwb)
,,,wbDTWB2.Navigate(@URL)
,ret _i
,

If don't want or cannot edit dialog code, this should work:
SelectTab id(3 w) iTab
URL.setwintext(id(100+iTab w))


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)