Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Popup window open link
#3
(04-20-2018, 08:41 AM)Gintaras Wrote: Macro dialog web browser open link in new dialog etc
Code:
Copy      Help
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.

Wow! Tongue QM is too great, less than a hundred lines of code, implementing four functions,

I really need to study hard QM programming

I found in the test, sometimes weird Huh , choose new dialog, will open from the web browser and new dialog at the same time

(04-20-2018, 08:41 AM)Gintaras Wrote: Macro dialog web browser open link in new dialog etc
Code:
Copy      Help
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.
thank you !!!

This link(http://static.flipbuilder.com/demo/sysco...index.html) is a Flash eBook page. I added it to the above code and it can display normally, but I want to implement the following two functions:

1. When the e-book is opened, the default full-screen display (without title bar and border)

2. When I press hot key F11, I can switch between full screen and standard mode

I found some flash full-screen code but I don't know how to add it to QM

//Open sets focus on full-screen Stage.focus
fscommand("fullscreen","true");//Close the code fscommand("quit");
//Or add a right-click menu control
var myMenu:ContextMenu = new ContextMenu();
myMenu.hideBuiltInItems();
var item:ContextMenuItem = new ContextMenuItem("full");
myMenu.customItems.push(item);
function fullScreen(evt:ContextMenuEvent):void
{
    if (item.caption == "full")
    {
        fscommand("fullscreen","true");
        item.caption = "quit full";
    }
    else
    {
        fscommand("fullscreen","false");
        item.caption = "full";
    }
}
item.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT,fullScreen);
contextMenu = myMenu;

I hope to give me some examples or suggestions, thanks in advance
  Heart


Messages In This Thread
Popup window open link - by win - 04-20-2018, 06:41 AM
RE: Popup window open link - by Gintaras - 04-20-2018, 08:41 AM
RE: Popup window open link - by win - 04-20-2018, 09:13 AM
RE: Popup window open link - by win - 04-20-2018, 11:36 AM
RE: Popup window open link - by Kevin - 04-20-2018, 04:28 PM
RE: Popup window open link - by win - 04-20-2018, 06:32 PM
RE: Popup window open link - by Kevin - 04-20-2018, 07:19 PM
RE: Popup window open link - by win - 04-20-2018, 08:25 PM
RE: Popup window open link - by win - 04-20-2018, 10:45 PM
RE: Popup window open link - by Kevin - 04-21-2018, 12:09 AM
RE: Popup window open link - by win - 04-21-2018, 03:13 AM
RE: Popup window open link - by Kevin - 04-21-2018, 03:18 AM
RE: Popup window open link - by win - 04-21-2018, 04:33 AM
RE: Popup window open link - by win - 04-21-2018, 05:59 AM
RE: Popup window open link - by Kevin - 04-21-2018, 11:46 PM
RE: Popup window open link - by win - 04-22-2018, 01:58 AM
RE: Popup window open link - by r0n - 04-22-2018, 04:33 PM
RE: Popup window open link - by Kevin - 04-22-2018, 05:39 PM
RE: Popup window open link - by win - 04-22-2018, 10:35 PM
RE: Popup window open link - by Kevin - 04-22-2018, 11:19 PM
RE: Popup window open link - by win - 04-22-2018, 11:24 PM

Forum Jump:


Users browsing this thread: 3 Guest(s)