Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Exe/Dialog with browser
#1
I forgot how to make a dialog and its hosted maximized SHDocVw.WebBrowser max too.
Could you please tell me again?

Code:
Copy      Help
BEGIN DIALOG
0 "" 0x10CF0A44 0x100 0 0 277 200 "Tickets"
3 ActiveX 0x54000000 0x4 12 20 236 154 "SHDocVw.WebBrowser"
4 Button 0x54032001 0x4 0 0 48 14 "Back"
5 Button 0x54032000 0x4 48 0 48 14 "Forward"
6 Button 0x54032000 0x0 96 0 48 14 "Stop"
7 Button 0x54032000 0x0 144 0 48 14 "Refresh"
8 Button 0x54032000 0x0 192 0 48 14 "Home"
END DIALOG
DIALOG EDITOR: "" 0x2010700 "" ""
pi
#2
Function Dialog213
Code:
Copy      Help
str dd=
;BEGIN DIALOG
;0 "" 0x90CF0AC8 0x0 0 0 626 318 "Dialog"
;3 ActiveX 0x54030000 0x0 0 16 626 302 "SHDocVw.WebBrowser {8856F961-340A-11D0-A96B-00C04FD705A2}"
;END DIALOG
;DIALOG EDITOR: "" 0x2040500 "*" "" "" ""

str controls = "3"
str ax3SHD
if(!ShowDialog(dd &sub.DlgProc &controls)) ret


#sub DlgProc
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
#3
i have this one.
need to understand how to have open it maximized.
Code:
Copy      Help
\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages

Web browser control is defined in SHDocWv type library, which is already declared, so we don't have to declare it again.

if(!ShowDialog("Dialog_with_web_browser" &Dialog_with_web_browser 0 _hwndqm)) ret

BEGIN DIALOG
0 "" 0x10CF0A44 0x100 0 0 1200 697 "Form"
3 ActiveX 0x54000000 0x4 0 16 1100 600 "SHDocVw.WebBrowser"
4 Button 0x54032001 0x4 0 0 48 14 "Back"
5 Button 0x54032000 0x4 48 0 48 14 "Forward"
6 Button 0x54032000 0x0 96 0 48 14 "Stop"
7 Button 0x54032000 0x0 144 0 48 14 "Refresh"
8 Button 0x54032000 0x0 192 0 48 14 "Home"
END DIALOG
DIALOG EDITOR: "" 0x2040500 "" "" "" ""


ret
messages
sel message
    case WM_INITDIALOG
    DT_Init(hDlg lParam)
    
    SHDocVw.WebBrowser we3._getcontrol(id(3 hDlg))
    we3._setevents("we3_DWebBrowserEvents2")
    we3.Navigate("http://tickets.stageled.com")
    
    ret 1
    
    case WM_SIZE
    RECT r; GetClientRect(hDlg &r)
     MoveWindow id(3 hDlg) 0 30 r.right r.bottom-30 1
    
    case WM_DESTROY
    DT_DeleteData(hDlg)
    
    case WM_COMMAND goto messages2
ret
messages2
sel wParam
    case [4,5,6,7,8]
    err-
    we3._getcontrol(id(3 hDlg))
    sel wParam
        case 4 we3.GoBack
        case 5 we3.GoForward
        case 6 we3.Stop
        case 7 we3.Refresh
        case 8 we3.GoHome
    err+
    
    case IDOK DT_Ok hDlg
    case IDCANCEL DT_Cancel hDlg
ret 1
pi
#4
max hDlg in case WM_INITDIALOG
#5
that works.
but how to have the SHDocVw.WebBrowser going max too?
3 ActiveX 0x54000000 0x4 0 16 1174 634 "SHDocVw.WebBrowser"
pi
#6
see the second post in this thread
#7
"3s"

it is control 3. what does the s mean?
pi
#8
s = size

Action - m (move) or s (resize).
Direction - h (horizontally) or v (vertically) or none (horiz and vert).

Example: 4mv => when user resizes dialog, control with ID 4, move vertically
#9
Thanks for your help.
It is working as expected now.
How do i make the exe remember its last monitor? Currently it is always opening on the first screen.
Is there a build in option or do i have to store it registry or ini file?
pi
#10
Found it.
RegWinPos
Dialog with Web Browser Auto Resize to suit screen
pi
#11
is there a way intercept download links?
i am logged in with my qm browser, but clicking a download link does open Internet Explorer asking for credencials.
right click does work, but my users always will click directly the link.
pi
#12
I'd probably try this:
WebBrowser control events.
Stackoverflow etc.


Forum Jump:


Users browsing this thread: 1 Guest(s)