Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Use button on the child window to open webpage on the main window
#1
Hello everyone, I want to use the right-click menu or the button in the dialog box to change the address of the web page in the main dialog box. I have encountered the following problem. I hope someone can help me, thanks in advance.

Question 1, I use two methods to open the dialog
1. Open the dialog box through the subroutine(sub.dia), but the error is indicated.
2. Open the dialog by defining a function(dia), which is normal

Question 2, when I click the right-click menu or button, it will not execute correctly


Macro swf menu
Code:
Copy      Help
str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 900 432 "Dialog"
;4 ActiveX 0x54030000 0x0 0 0 900 432 "SHDocVw.WebBrowser {8856F961-340A-11D0-A96B-00C04FD705A2}"
;END DIALOG
;DIALOG EDITOR: "" 0x2040700 "*" "" "" ""

str controls = "4"
str ax4SHD
ax4SHD="http://fs.focusky.com.cn/jhgh/tdzl/index.html"
if(!ShowDialog(dd &sub.DlgProc &controls)) ret


#sub DlgProc
function# hDlg message wParam lParam

sel message
,case WM_INITDIALOG
,SetTimer hDlg 1 100 0
,SHDocVw.WebBrowser we4
,we4._getcontrol(id(4 hDlg))
,we4._setevents("sub.we4")
,
,case WM_TIMER
,sel wParam
,,case 1
,,int wies=child("" "Internet Explorer_Server" id(4 hDlg)); if(wies=0) ret
,,SetWindowSubclass(wies &sub.WndProc_Subclass 2 0)
,,int mfpax2 mfpax=child("" "MacromediaFlashPlayerActiveX" id(4 hDlg));
,,if(mfpax!=0 and mfpax2!=mfpax)
,,,SetWindowSubclass(mfpax &sub.WndProc_Subclass 2 0)
,,,mfpax2=mfpax
,,else
,,,ret
,,KillTimer hDlg wParam
,,mac "swfmenu" "" mfpax hDlg
,
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
ret 1


#sub WndProc_Subclass
function# hwnd message wParam lParam uIdSubclass dwRefData

;OutWinMsg message wParam lParam ;;uncomment to see received messages

sel message
,case WM_RBUTTONDOWN
,str s=
,;1 pop dialog
,;-
,;2 change maindialog url
,MenuPopup x.AddItems(s)
,int i=x.Show
,sel i
,,case 1
,,dia
,,;sub.dia ;;Unable to open dialog via subroutine
,,case 2 ;;Prompt error
,,SHDocVw.WebBrowser we4
,,we4._getcontrol(id(4 hDlg))
,,we4.Navigate("http://fs.focusky.com.cn/slgus/ybbt/index.html?flash")
,ret

int R=DefSubclassProc(hwnd message wParam lParam)

sel message
,case WM_NCDESTROY
,RemoveWindowSubclass(hwnd &sub.WndProc_Subclass uIdSubclass)
,
,;case ...

ret R

#sub we4_NewWindow3
function IDispatch&ppDisp @&Cancel dwFlags BSTR'bstrUrlContext BSTR'bstrUrl SHDocVw.IWebBrowser2'we3

int hDlg2=sub.Dialog2
SHDocVw.WebBrowser d2_we3._getcontrol(id(3 hDlg2))
ppDisp=d2_we3


#sub Dialog2
function# [hwndOwner]

str dd=
;BEGIN DIALOG
;0 "" 0x90CF0AC8 0x0 0 0 900 432 "Dialog2"
;3 ActiveX 0x54030000 0x0 0 0 900 432 "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
int- t_hdlg

sel message
,case WM_INITDIALOG
,SHDocVw.WebBrowser we3
,we3._getcontrol(id(3 hDlg))
,we3._setevents("sub.we3")
,t_hdlg=hDlg
,DT_SetAutoSizeControls hDlg "3s"
,SetTimer hDlg 1 100 0
,case WM_TIMER
,sel wParam
,,case 1
,,int wies=child("" "Internet Explorer_Server" id(3 hDlg)); if(wies=0) ret
,,SetWindowSubclass(wies &sub.WndProc_Subclass 2 0)
,,KillTimer hDlg wParam
,case WM_DESTROY
,case WM_COMMAND goto messages2
,case WM_CLOSE
,DT_Ok(hDlg)
ret
;messages2
sel wParam
,case IDOK
,ifk(Y)
,,key Y           ;; Enter
,,ret 0
,case IDCANCEL
,ret 0

ret 1

#sub we3_WindowClosing
function @IsChildWindow @&Cancel ;;SHDocVw.IWebBrowser2'we3

Cancel=1
int- t_hdlg
clo t_hdlg

#sub dia

str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 224 136 "Dialog"
;1 Button 0x54030001 0x4 116 116 48 14 "OK"
;2 Button 0x54030000 0x4 168 116 48 14 "Cancel"
;END DIALOG
;DIALOG EDITOR: "" 0 "*" "" "" ""

if(!ShowDialog(dd &sub.DlgProc 0)) ret


#sub DlgProc
function# hDlg message wParam lParam

sel message
,case WM_INITDIALOG
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
,case 3 ;;mes
,mes "ok"
ret 1

Function dia
Code:
Copy      Help
str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 224 136 "Dialog"
;3 Button 0x54032000 0x0 36 32 84 14 "change maindialog url"
;1 Button 0x54030001 0x4 116 116 48 14 "OK"
;2 Button 0x54030000 0x4 168 116 48 14 "Cancel"
;END DIALOG
;DIALOG EDITOR: "" 0x2040701 "*" "" "" ""

if(!ShowDialog(dd &sub.DlgProc 0)) ret


#sub DlgProc
function# hDlg message wParam lParam

sel message
,case WM_INITDIALOG
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
,case 3 
,SHDocVw.WebBrowser we4
,we4._getcontrol(id(4 hDlg))
,we4.Navigate("http://fs.focusky.com.cn/slgus/ybbt/index.html?flash")
ret 1
#2
wow many many mistakes here

the reason your sub dia function doesnt work because your calling  #sub DlgProc   in your showdialog statement for dia which is incorrect and is actually the dialog process for your main dialog
change to


Code:
Copy      Help
#sub dia
str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 224 136 "Dialog"
;3 Button 0x54032000 0x0 36 32 84 14 "change maindialog url"
;1 Button 0x54030001 0x4 116 116 48 14 "OK"
;2 Button 0x54030000 0x4 168 116 48 14 "Cancel"
;END DIALOG
;DIALOG EDITOR: "" 0x2040701 "*" "" "" ""

if(!ShowDialog(dd &sub.DlgProc3 0)) ret


#sub DlgProc3

why is this in your code?
mac "swfmenu" "" mfpax hDlg

remove it will cause another error. why would you try and launch the same dialog again?

hDlg is not a global variable .
sub WndProc_Subclass doesnt know what hDlg is. 
You have made this same mistake a few times before. If you look in the the full code the answer is there not covering it again.Or look back in your previous posts.

You made the same mistake in function dia as well.
dia has no idea what the window handle of the main dialog is
from what i can see sub dia and function dia are not needed at all. Why make another dialog when the same thing is done easier with the other right click menu option.

another problem you will have once you get it working is once you change the url the right click menu will stop working as well. will need to call SetTimer again because the window is destroyed when you changed the url.

I will suggest again for you to learn what the code does before trying to use it differently .
#3
Function swf_menu
Code:
Copy      Help
str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 900 432 "Dialog"
;4 ActiveX 0x54030000 0x0 0 0 900 432 "SHDocVw.WebBrowser {8856F961-340A-11D0-A96B-00C04FD705A2}"
;END DIALOG
;DIALOG EDITOR: "" 0x2040700 "*" "" "" ""

WebBrowserControlDisableIE7Emulation
str controls = "4"
str ax4SHD
ax4SHD="http://fs.focusky.com.cn/jhgh/tdzl/index.html"
if(!ShowDialog(dd &sub.DlgProc &controls)) ret

#sub DlgProc
function# hDlg message wParam lParam
int- t_MhDlg
sel message
,case WM_INITDIALOG
,SetTimer hDlg 1 100 0
,SHDocVw.WebBrowser we4
,we4._getcontrol(id(4 hDlg))
,we4._setevents("sub.we4")
,t_MhDlg=hDlg
,case WM_TIMER
,sel wParam
,,case 1
,,int wies=child("" "Internet Explorer_Server" id(4 hDlg)); if(wies=0) ret
,,SetWindowSubclass(wies &sub.WndProc_Subclass 2 0)
,,int mfpax2 mfpax=child("" "MacromediaFlashPlayerActiveX" id(4 hDlg));
,,if(mfpax!=0 and mfpax2!=mfpax)
,,,SetWindowSubclass(mfpax &sub.WndProc_Subclass 2 0)
,,,mfpax2=mfpax
,,else
,,,ret
,,KillTimer hDlg wParam
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
ret 1

#sub WndProc_Subclass
function# hwnd message wParam lParam uIdSubclass dwRefData

;OutWinMsg message wParam lParam ;;uncomment to see received messages

sel message
,case WM_RBUTTONDOWN
,str s=
,;1 change maindialog url
,MenuPopup x.AddItems(s)
,int i=x.Show
,sel i
,,case 1
,,int- t_MhDlg
,,SHDocVw.WebBrowser we4
,,we4._getcontrol(id(4 t_MhDlg))
,,str url=we4.LocationURL
,,if url = "http://fs.focusky.com.cn/jhgh/tdzl/index.html"
,,,we4.Navigate("http://fs.focusky.com.cn/slgus/ybbt/index.html?flash")
,,else
,,,we4.Navigate("http://fs.focusky.com.cn/jhgh/tdzl/index.html")
,,SetTimer t_MhDlg 1 100 0
,ret

int R=DefSubclassProc(hwnd message wParam lParam)

sel message
,case WM_NCDESTROY
,RemoveWindowSubclass(hwnd &sub.WndProc_Subclass uIdSubclass)
,
,;case ...

ret R

#sub we4_NewWindow3
function IDispatch&ppDisp @&Cancel dwFlags BSTR'bstrUrlContext BSTR'bstrUrl SHDocVw.IWebBrowser2'we3

int hDlg2=sub.Dialog2
SHDocVw.WebBrowser d2_we3._getcontrol(id(3 hDlg2))
ppDisp=d2_we3


#sub Dialog2
function# [hwndOwner]

str dd=
;BEGIN DIALOG
;0 "" 0x90CF0AC8 0x0 0 0 900 432 "Dialog2"
;3 ActiveX 0x54030000 0x0 0 0 900 432 "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
int- t_hdlg

sel message
,case WM_INITDIALOG
,SHDocVw.WebBrowser we3
,we3._getcontrol(id(3 hDlg))
,we3._setevents("sub.we3")
,t_hdlg=hDlg
,DT_SetAutoSizeControls hDlg "3s"
,SetTimer hDlg 1 100 0
,case WM_TIMER
,sel wParam
,,case 1
,,int wies=child("" "Internet Explorer_Server" id(3 hDlg)); if(wies=0) ret
,,SetWindowSubclass(wies &sub.WndProc_Subclass 2 0)
,,KillTimer hDlg wParam
,case WM_DESTROY
,case WM_COMMAND goto messages2
,case WM_CLOSE
,DT_Ok(hDlg)
ret
;messages2
sel wParam
,case IDOK
,ifk(Y)
,,key Y           ;; Enter
,,ret 0
,case IDCANCEL
,ret 0
ret 1

#sub we3_WindowClosing
function @IsChildWindow @&Cancel ;;SHDocVw.IWebBrowser2'we3

Cancel=1
int- t_hdlg
clo t_hdlg
#4
Thank you for your help

Now use the right-click menu to switch to the new page correctly, but on the new page, the right-click menu is not available, I hope the right-click menu is always available.

I want to have multiple menu items in the right-click menu that can be switched to each other.

Can I change the web address in the main dialog through the buttons in the sub-dialog?

In the code now, the right-click menu has no sub-dialogs.

Just tested, the two URLs can switch between each other   Smile

How can I easily add multiple menu items and set their links?  Huh
#5
Function swf_menu2
Code:
Copy      Help
str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 900 432 "Dialog"
;4 ActiveX 0x54030000 0x0 0 0 900 432 "SHDocVw.WebBrowser {8856F961-340A-11D0-A96B-00C04FD705A2}"
;END DIALOG
;DIALOG EDITOR: "" 0x2040700 "*" "" "" ""

WebBrowserControlDisableIE7Emulation
str controls = "4"
str ax4SHD
ax4SHD="http://fs.focusky.com.cn/jhgh/tdzl/index.html"
if(!ShowDialog(dd &sub.DlgProc &controls)) ret

#sub DlgProc
function# hDlg message wParam lParam
int- t_MhDlg
sel message
,case WM_INITDIALOG
,SetTimer hDlg 1 100 0
,SHDocVw.WebBrowser we4
,we4._getcontrol(id(4 hDlg))
,we4._setevents("sub.we4")
,t_MhDlg=hDlg
,case WM_TIMER
,sel wParam
,,case 1
,,int wies=child("" "Internet Explorer_Server" id(4 hDlg)); if(wies=0) ret
,,SetWindowSubclass(wies &sub.WndProc_Subclass 2 0)
,,int mfpax2 mfpax=child("" "MacromediaFlashPlayerActiveX" id(4 hDlg));
,,if(mfpax!=0 and mfpax2!=mfpax)
,,,SetWindowSubclass(mfpax &sub.WndProc_Subclass 2 0)
,,,mfpax2=mfpax
,,else
,,,ret
,,KillTimer hDlg wParam
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
ret 1

#sub WndProc_Subclass
function# hwnd message wParam lParam uIdSubclass dwRefData

;OutWinMsg message wParam lParam ;;uncomment to see received messages

sel message
,case WM_RBUTTONDOWN
,str s=
,;1 Change Main dialog url
,;2 Google
,;3 Yahoo
,;4 Bing
,;5 Quick Macros Forum
,
,MenuPopup x.AddItems(s)
,int i=x.Show
,int- t_MhDlg
,SHDocVw.WebBrowser wb
,wb._getcontrol(id(4 t_MhDlg))
,sel i
,,case 1
,,str url=wb.LocationURL
,,if url = "http://fs.focusky.com.cn/jhgh/tdzl/index.html"
,,,wb.Navigate("http://fs.focusky.com.cn/slgus/ybbt/index.html?flash")
,,else
,,,wb.Navigate("http://fs.focusky.com.cn/jhgh/tdzl/index.html")
,,SetTimer t_MhDlg 1 100 0
,,case 2
,,wb.Navigate("https://www.google.com")
,,case 3
,,wb.Navigate("https://www.yahoo.com")
,,case 4
,,wb.Navigate("https://www.bing.com")
,,case 5
,,wb.Navigate("http://www.quickmacros.com/forum")
,ret

int R=DefSubclassProc(hwnd message wParam lParam)

sel message
,case WM_NCDESTROY
,RemoveWindowSubclass(hwnd &sub.WndProc_Subclass uIdSubclass)
,
,;case ...

ret R

#sub we4_NewWindow3
function IDispatch&ppDisp @&Cancel dwFlags BSTR'bstrUrlContext BSTR'bstrUrl SHDocVw.IWebBrowser2'we3

int hDlg2=sub.Dialog2
SHDocVw.WebBrowser d2_we3._getcontrol(id(3 hDlg2))
ppDisp=d2_we3


#sub Dialog2
function# [hwndOwner] [~url]

str dd=
;BEGIN DIALOG
;0 "" 0x90CF0AC8 0x0 0 0 900 432 "Dialog2"
;3 ActiveX 0x54030000 0x0 0 0 900 432 "SHDocVw.WebBrowser {8856F961-340A-11D0-A96B-00C04FD705A2}"
;END DIALOG
;DIALOG EDITOR: "" 0x2040701 "*" "" "" ""

str controls = "3"
str ax3SHD
if(!empty(url))
,ax3SHD=url
ret ShowDialog(dd &sub.DlgProc2 &controls hwndOwner 1) ;;modeless dialog


#sub DlgProc2
function# hDlg message wParam lParam
int- t_hdlg

sel message
,case WM_INITDIALOG
,SHDocVw.WebBrowser we3
,we3._getcontrol(id(3 hDlg))
,we3._setevents("sub.we3")
,t_hdlg=hDlg
,DT_SetAutoSizeControls hDlg "3s"
,SetTimer hDlg 1 100 0
,case WM_TIMER
,sel wParam
,,case 1
,,int wies=child("" "Internet Explorer_Server" id(3 hDlg)); if(wies=0) ret
,,SetWindowSubclass(wies &sub.WndProc_Subclass 2 0)
,,KillTimer hDlg wParam
,case WM_DESTROY
,case WM_COMMAND goto messages2
,case WM_CLOSE
,DT_Ok(hDlg)
ret
;messages2
sel wParam
,case IDOK
,ifk(Y)
,,key Y           ;; Enter
,,ret 0
,case IDCANCEL
,ret 0
ret 1

#sub we3_WindowClosing
function @IsChildWindow @&Cancel ;;SHDocVw.IWebBrowser2'we3

Cancel=1
int- t_hdlg
clo t_hdlg


Just keep in mind any url you add that will load flash will need to call SetTimer so the right click menu will work on the new page. If new url doesnt load flash you don't need to call SetTimer.
#6
Thank you, very good. Smile

I found the code for the second dialog in the code.

What is his role? Huh

I added the hotkey F10 to the code to make the window full screen.

However, in actual use, there are often errors in not finding objects. I set the wait and still have errors.

How to use full screen code is more stable?


Macro Macro1
Trigger SF9     Help - how to add the trigger to the macro
Code:
Copy      Help
str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 900 432 "Dialog"
;4 ActiveX 0x54030000 0x0 0 0 900 432 "SHDocVw.WebBrowser {8856F961-340A-11D0-A96B-00C04FD705A2}"
;END DIALOG
;DIALOG EDITOR: "" 0x2040700 "*" "" "" ""

WebBrowserControlDisableIE7Emulation
str controls = "4"
str ax4SHD
ax4SHD="http://fs.focusky.com.cn/jhgh/tdzl/index.html"
if(!ShowDialog(dd &sub.DlgProc &controls)) ret

#sub DlgProc
function# hDlg message wParam lParam
int- t_MhDlg
sel message
,case WM_INITDIALOG
,DT_SetAccelerators hDlg "410 F10[]412 F12"
,SetTimer hDlg 1 100 0
,SHDocVw.WebBrowser we4
,we4._getcontrol(id(4 hDlg))
,we4._setevents("sub.we4")
,t_MhDlg=hDlg
,case WM_TIMER
,sel wParam
,,case 1
,,int wies=child("" "Internet Explorer_Server" id(4 hDlg)); if(wies=0) ret
,,SetWindowSubclass(wies &sub.WndProc_Subclass 2 0)
,,int mfpax2 mfpax=child("" "MacromediaFlashPlayerActiveX" id(4 hDlg));
,,if(mfpax!=0 and mfpax2!=mfpax)
,,,SetWindowSubclass(mfpax &sub.WndProc_Subclass 2 0)
,,,mfpax2=mfpax
,,else
,,,ret
,,KillTimer hDlg wParam
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case 410
,key F11
,0.1
,scan "image:hAF522030" 0 0 1|2|16
,lef
,case IDOK
,case IDCANCEL
ret 1

#sub WndProc_Subclass
function# hwnd message wParam lParam uIdSubclass dwRefData

;OutWinMsg message wParam lParam ;;uncomment to see received messages

sel message
,case WM_RBUTTONDOWN
,str s=
,;1 Change Main dialog url
,;2 Google
,;3 Yahoo
,;4 Bing
,;5 Quick Macros Forum
,
,MenuPopup x.AddItems(s)
,int i=x.Show
,int- t_MhDlg
,SHDocVw.WebBrowser wb
,wb._getcontrol(id(4 t_MhDlg))
,sel i
,,case 1
,,str url=wb.LocationURL
,,if url = "http://fs.focusky.com.cn/jhgh/tdzl/index.html"
,,,wb.Navigate("http://fs.focusky.com.cn/slgus/ybbt/index.html?flash")
,,else
,,,wb.Navigate("http://fs.focusky.com.cn/jhgh/tdzl/index.html")
,,SetTimer t_MhDlg 1 100 0
,,case 2
,,wb.Navigate("https://www.google.com")
,,case 3
,,wb.Navigate("https://www.yahoo.com")
,,case 4
,,wb.Navigate("https://www.bing.com")
,,case 5
,,wb.Navigate("http://www.quickmacros.com/forum")
,ret

int R=DefSubclassProc(hwnd message wParam lParam)

sel message
,case WM_NCDESTROY
,RemoveWindowSubclass(hwnd &sub.WndProc_Subclass uIdSubclass)
,
,;case ...

ret R

#sub we4_NewWindow3
function IDispatch&ppDisp @&Cancel dwFlags BSTR'bstrUrlContext BSTR'bstrUrl SHDocVw.IWebBrowser2'we3

int hDlg2=sub.Dialog2
SHDocVw.WebBrowser d2_we3._getcontrol(id(3 hDlg2))
ppDisp=d2_we3


#sub Dialog2
function# [hwndOwner] [~url]

str dd=
;BEGIN DIALOG
;0 "" 0x90CF0AC8 0x0 0 0 900 432 "Dialog2"
;3 ActiveX 0x54030000 0x0 0 0 900 432 "SHDocVw.WebBrowser {8856F961-340A-11D0-A96B-00C04FD705A2}"
;END DIALOG
;DIALOG EDITOR: "" 0x2040701 "*" "" "" ""

str controls = "3"
str ax3SHD
if(!empty(url))
,ax3SHD=url
ret ShowDialog(dd &sub.DlgProc2 &controls hwndOwner 1) ;;modeless dialog


#sub DlgProc2
function# hDlg message wParam lParam
int- t_hdlg

sel message
,case WM_INITDIALOG
,SHDocVw.WebBrowser we3
,we3._getcontrol(id(3 hDlg))
,we3._setevents("sub.we3")
,t_hdlg=hDlg
,DT_SetAutoSizeControls hDlg "3s"
,SetTimer hDlg 1 100 0
,case WM_TIMER
,sel wParam
,,case 1
,,int wies=child("" "Internet Explorer_Server" id(3 hDlg)); if(wies=0) ret
,,SetWindowSubclass(wies &sub.WndProc_Subclass 2 0)
,,KillTimer hDlg wParam
,case WM_DESTROY
,case WM_COMMAND goto messages2
,case WM_CLOSE
,DT_Ok(hDlg)
ret
;messages2
sel wParam
,case IDOK
,ifk(Y)
,,key Y           ;; Enter
,,ret 0
,case IDCANCEL
,ret 0
ret 1

#sub we3_WindowClosing
function @IsChildWindow @&Cancel ;;SHDocVw.IWebBrowser2'we3

Cancel=1
int- t_hdlg
clo t_hdlg
;BEGIN PROJECT
;main_function  Macro1
;exe_file  $my qm$\Macro1.exe
;icon  <default>
;manifest  $qm$\default.exe.manifest
;flags  6
;guid  {4720E404-009B-439E-8B75-8947532A37AE}
;END PROJECT


Attached Files Image(s)
   
#7
image 
prees alt+F6 import

It's a bit strange, the F10 hotkey doesn't work properly under another flash page.   Huh


Attached Files Image(s)
   
#8
couldn't get your image to work so i made another and it works in both flash urls
i moved all the code to a sub function and change code to use wait instead if scan also had to move mouse cursor after clicking because if mouse isn't moved  wont work second time
Code:
Copy      Help
str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 900 432 "Dialog"
;4 ActiveX 0x54030000 0x0 0 0 900 432 "SHDocVw.WebBrowser {8856F961-340A-11D0-A96B-00C04FD705A2}"
;END DIALOG
;DIALOG EDITOR: "" 0x2040700 "*" "" "" ""

WebBrowserControlDisableIE7Emulation
str controls = "4"
str ax4SHD
ax4SHD="http://fs.focusky.com.cn/jhgh/tdzl/index.html"
if(!ShowDialog(dd &sub.DlgProc &controls)) ret

#sub DlgProc
function# hDlg message wParam lParam
int- t_MhDlg
sel message
,case WM_INITDIALOG
,DT_SetAccelerators hDlg "410 F10[]412 F12"
,SetTimer hDlg 1 100 0
,SHDocVw.WebBrowser we4
,we4._getcontrol(id(4 hDlg))
,we4._setevents("sub.we4")
,t_MhDlg=hDlg
,case WM_TIMER
,sel wParam
,,case 1
,,int wies=child("" "Internet Explorer_Server" id(4 hDlg)); if(wies=0) ret
,,SetWindowSubclass(wies &sub.WndProc_Subclass 2 0)
,,int mfpax2 mfpax=child("" "MacromediaFlashPlayerActiveX" id(4 hDlg));
,,if(mfpax!=0 and mfpax2!=mfpax)
,,,SetWindowSubclass(mfpax &sub.WndProc_Subclass 2 0)
,,,mfpax2=mfpax
,,else
,,,ret
,,KillTimer hDlg wParam
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case 410
,mac "sub.FlashFullscreen"
,case IDOK
,case IDCANCEL
ret 1

#sub WndProc_Subclass
function# hwnd message wParam lParam uIdSubclass dwRefData

;OutWinMsg message wParam lParam ;;uncomment to see received messages

sel message
,case WM_RBUTTONDOWN
,str s=
,;1 Change Main dialog url
,;2 Google
,;3 Yahoo
,;4 Bing
,;5 Quick Macros Forum
,
,MenuPopup x.AddItems(s)
,int i=x.Show
,int- t_MhDlg
,SHDocVw.WebBrowser wb
,wb._getcontrol(id(4 t_MhDlg))
,sel i
,,case 1
,,str url=wb.LocationURL
,,if url = "http://fs.focusky.com.cn/jhgh/tdzl/index.html"
,,,wb.Navigate("http://fs.focusky.com.cn/slgus/ybbt/index.html?flash")
,,else
,,,wb.Navigate("http://fs.focusky.com.cn/jhgh/tdzl/index.html")
,,SetTimer t_MhDlg 1 100 0
,,case 2
,,wb.Navigate("https://www.google.com")
,,case 3
,,wb.Navigate("https://www.yahoo.com")
,,case 4
,,wb.Navigate("https://www.bing.com")
,,case 5
,,wb.Navigate("http://www.quickmacros.com/forum")
,ret

int R=DefSubclassProc(hwnd message wParam lParam)

sel message
,case WM_NCDESTROY
,RemoveWindowSubclass(hwnd &sub.WndProc_Subclass uIdSubclass)
,
,;case ...

ret R

#sub we4_NewWindow3
function IDispatch&ppDisp @&Cancel dwFlags BSTR'bstrUrlContext BSTR'bstrUrl SHDocVw.IWebBrowser2'we3

int hDlg2=sub.Dialog2
SHDocVw.WebBrowser d2_we3._getcontrol(id(3 hDlg2))
ppDisp=d2_we3


#sub Dialog2
function# [hwndOwner] [~url]

str dd=
;BEGIN DIALOG
;0 "" 0x90CF0AC8 0x0 0 0 900 432 "Dialog2"
;3 ActiveX 0x54030000 0x0 0 0 900 432 "SHDocVw.WebBrowser {8856F961-340A-11D0-A96B-00C04FD705A2}"
;END DIALOG
;DIALOG EDITOR: "" 0x2040701 "*" "" "" ""

str controls = "3"
str ax3SHD
if(!empty(url))
,ax3SHD=url
ret ShowDialog(dd &sub.DlgProc2 &controls hwndOwner 1) ;;modeless dialog


#sub DlgProc2
function# hDlg message wParam lParam
int- t_hdlg

sel message
,case WM_INITDIALOG
,SHDocVw.WebBrowser we3
,we3._getcontrol(id(3 hDlg))
,we3._setevents("sub.we3")
,t_hdlg=hDlg
,DT_SetAutoSizeControls hDlg "3s"
,SetTimer hDlg 1 100 0
,case WM_TIMER
,sel wParam
,,case 1
,,int wies=child("" "Internet Explorer_Server" id(3 hDlg)); if(wies=0) ret
,,SetWindowSubclass(wies &sub.WndProc_Subclass 2 0)
,,KillTimer hDlg wParam
,case WM_DESTROY
,case WM_COMMAND goto messages2
,case WM_CLOSE
,DT_Ok(hDlg)
ret
;messages2
sel wParam
,case IDOK
,ifk(Y)
,,key Y           ;; Enter
,,ret 0
,case IDCANCEL
,ret 0
ret 1

#sub we3_WindowClosing
function @IsChildWindow @&Cancel ;;SHDocVw.IWebBrowser2'we3

Cancel=1
int- t_hdlg
clo t_hdlg

#sub FlashFullscreen
key F11 
0.3
int w=win("" "ShockwaveFlashFullScreen")
wait 0 S "image:hDA7E4E62" w 0 1|16|0x400
lef
mou 0.5 0.5
here is the new image goodluck
   
#9
The second window often appears when the right-click menu cannot be popped up. Huh
#10
Not sure  i follow  what you  mean exactly. Everything  was working on my pc.
#11
I need constant testing. Later, I will feedback the usage, thank you for your help.

If there is English in the picture, it cannot be used under the Chinese operating system because the characters on the button will change.
#12
try this

Code:
Copy      Help
str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 900 432 "Dialog"
;4 ActiveX 0x54030000 0x0 0 0 900 432 "SHDocVw.WebBrowser {8856F961-340A-11D0-A96B-00C04FD705A2}"
;END DIALOG
;DIALOG EDITOR: "" 0x2040700 "*" "" "" ""

WebBrowserControlDisableIE7Emulation
str controls = "4"
str ax4SHD
ax4SHD="http://fs.focusky.com.cn/jhgh/tdzl/index.html"
if(!ShowDialog(dd &sub.DlgProc &controls)) ret

#sub DlgProc
function# hDlg message wParam lParam
int- t_MhDlg
sel message
,case WM_INITDIALOG
,DT_SetAccelerators hDlg "410 F10[]412 F12"
,SetTimer hDlg 1 100 0
,SHDocVw.WebBrowser we4
,we4._getcontrol(id(4 hDlg))
,we4._setevents("sub.we4")
,t_MhDlg=hDlg
,case WM_TIMER
,sel wParam
,,case 1
,,int wies=child("" "Internet Explorer_Server" id(4 hDlg)); if(wies=0) ret
,,SetWindowSubclass(wies &sub.WndProc_Subclass 2 0)
,,int mfpax2 mfpax=child("" "MacromediaFlashPlayerActiveX" id(4 hDlg));
,,if(mfpax!=0 and mfpax2!=mfpax)
,,,SetWindowSubclass(mfpax &sub.WndProc_Subclass 2 0)
,,,mfpax2=mfpax
,,else
,,,ret
,,KillTimer hDlg wParam
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case 410
,mac "sub.FlashFullscreen"
,case IDOK
,case IDCANCEL
ret 1

#sub WndProc_Subclass
function# hwnd message wParam lParam uIdSubclass dwRefData

;OutWinMsg message wParam lParam ;;uncomment to see received messages

sel message
,case WM_RBUTTONDOWN
,str s=
,;1 Change Main dialog url
,;2 Google
,;3 Yahoo
,;4 Bing
,;5 Quick Macros Forum
,
,MenuPopup x.AddItems(s)
,int i=x.Show
,int- t_MhDlg
,SHDocVw.WebBrowser wb
,wb._getcontrol(id(4 t_MhDlg))
,sel i
,,case 1
,,str url=wb.LocationURL
,,if url = "http://fs.focusky.com.cn/jhgh/tdzl/index.html"
,,,wb.Navigate("http://fs.focusky.com.cn/slgus/ybbt/index.html?flash")
,,else
,,,wb.Navigate("http://fs.focusky.com.cn/jhgh/tdzl/index.html")
,,SetTimer t_MhDlg 1 100 0
,,case 2
,,wb.Navigate("https://www.google.com")
,,case 3
,,wb.Navigate("https://www.yahoo.com")
,,case 4
,,wb.Navigate("https://www.bing.com")
,,case 5
,,wb.Navigate("http://www.quickmacros.com/forum")
,ret

int R=DefSubclassProc(hwnd message wParam lParam)

sel message
,case WM_NCDESTROY
,RemoveWindowSubclass(hwnd &sub.WndProc_Subclass uIdSubclass)
,
,;case ...

ret R

#sub we4_NewWindow3
function IDispatch&ppDisp @&Cancel dwFlags BSTR'bstrUrlContext BSTR'bstrUrl SHDocVw.IWebBrowser2'we3

int hDlg2=sub.Dialog2
SHDocVw.WebBrowser d2_we3._getcontrol(id(3 hDlg2))
ppDisp=d2_we3


#sub Dialog2
function# [hwndOwner] [~url]

str dd=
;BEGIN DIALOG
;0 "" 0x90CF0AC8 0x0 0 0 900 432 "Dialog2"
;3 ActiveX 0x54030000 0x0 0 0 900 432 "SHDocVw.WebBrowser {8856F961-340A-11D0-A96B-00C04FD705A2}"
;END DIALOG
;DIALOG EDITOR: "" 0x2040701 "*" "" "" ""

str controls = "3"
str ax3SHD
if(!empty(url))
,ax3SHD=url
ret ShowDialog(dd &sub.DlgProc2 &controls hwndOwner 1) ;;modeless dialog


#sub DlgProc2
function# hDlg message wParam lParam
int- t_hdlg

sel message
,case WM_INITDIALOG
,SHDocVw.WebBrowser we3
,we3._getcontrol(id(3 hDlg))
,we3._setevents("sub.we3")
,t_hdlg=hDlg
,DT_SetAutoSizeControls hDlg "3s"
,SetTimer hDlg 1 100 0
,case WM_TIMER
,sel wParam
,,case 1
,,int wies=child("" "Internet Explorer_Server" id(3 hDlg)); if(wies=0) ret
,,SetWindowSubclass(wies &sub.WndProc_Subclass 2 0)
,,KillTimer hDlg wParam
,case WM_DESTROY
,case WM_COMMAND goto messages2
,case WM_CLOSE
,DT_Ok(hDlg)
ret
;messages2
sel wParam
,case IDOK
,ifk(Y)
,,key Y           ;; Enter
,,ret 0
,case IDCANCEL
,ret 0
ret 1

#sub we3_WindowClosing
function @IsChildWindow @&Cancel ;;SHDocVw.IWebBrowser2'we3

Cancel=1
int- t_hdlg
clo t_hdlg

#sub FlashFullscreen
key F11 
0.3
int w=win("" "ShockwaveFlashFullScreen")
scan "image:h2F7BFF9D" w 0 1|2|16
lef
mou 0.5 0.5
new image
   
#13
I added swf 3 to the right-click menu. However, after switching to swf 3, the context menu cannot be popped up.

In actual use, I need to switch a lot of swf pages. Confused


Macro Macro2
Code:
Copy      Help
str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 900 432 "Dialog"
;4 ActiveX 0x54030000 0x0 0 0 900 432 "SHDocVw.WebBrowser {8856F961-340A-11D0-A96B-00C04FD705A2}"
;END DIALOG
;DIALOG EDITOR: "" 0x2040700 "*" "" "" ""

WebBrowserControlDisableIE7Emulation
str controls = "4"
str ax4SHD
ax4SHD="http://fs.focusky.com.cn/jhgh/tdzl/index.html"
if(!ShowDialog(dd &sub.DlgProc &controls)) ret

#sub DlgProc
function# hDlg message wParam lParam
int- t_MhDlg
sel message
,case WM_INITDIALOG
,DT_SetAccelerators hDlg "410 F10[]412 F12"
,SetTimer hDlg 1 100 0
,SHDocVw.WebBrowser we4
,we4._getcontrol(id(4 hDlg))
,we4._setevents("sub.we4")
,t_MhDlg=hDlg
,case WM_TIMER
,sel wParam
,,case 1
,,int wies=child("" "Internet Explorer_Server" id(4 hDlg)); if(wies=0) ret
,,SetWindowSubclass(wies &sub.WndProc_Subclass 2 0)
,,int mfpax2 mfpax=child("" "MacromediaFlashPlayerActiveX" id(4 hDlg));
,,if(mfpax!=0 and mfpax2!=mfpax)
,,,SetWindowSubclass(mfpax &sub.WndProc_Subclass 2 0)
,,,mfpax2=mfpax
,,else
,,,ret
,,KillTimer hDlg wParam
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case 410
,mac "sub.FlashFullscreen"
,case IDOK
,case IDCANCEL
ret 1

#sub WndProc_Subclass
function# hwnd message wParam lParam uIdSubclass dwRefData

;OutWinMsg message wParam lParam ;;uncomment to see received messages

sel message
,case WM_RBUTTONDOWN
,str s=
,;1 Change Main dialog url
,;2 swf 3
,;3 Yahoo
,;4 Bing
,;5 Quick Macros Forum
,
,MenuPopup x.AddItems(s)
,int i=x.Show
,int- t_MhDlg
,SHDocVw.WebBrowser wb
,wb._getcontrol(id(4 t_MhDlg))
,sel i
,,case 1
,,str url=wb.LocationURL
,,if url = "http://fs.focusky.com.cn/jhgh/tdzl/index.html"
,,,wb.Navigate("http://fs.focusky.com.cn/slgus/ybbt/index.html?flash")
,,else
,,,wb.Navigate("http://fs.focusky.com.cn/jhgh/tdzl/index.html")
,,SetTimer t_MhDlg 1 100 0
,,case 2
,,wb.Navigate("http://fs.focusky.com.cn/uxwbx/qbtq/index.html?flash")
,,case 3
,,wb.Navigate("https://www.yahoo.com")
,,case 4
,,wb.Navigate("https://www.bing.com")
,,case 5
,,wb.Navigate("http://www.quickmacros.com/forum")
,ret

int R=DefSubclassProc(hwnd message wParam lParam)

sel message
,case WM_NCDESTROY
,RemoveWindowSubclass(hwnd &sub.WndProc_Subclass uIdSubclass)
,
,;case ...

ret R

#sub we4_NewWindow3
function IDispatch&ppDisp @&Cancel dwFlags BSTR'bstrUrlContext BSTR'bstrUrl SHDocVw.IWebBrowser2'we3

int hDlg2=sub.Dialog2
SHDocVw.WebBrowser d2_we3._getcontrol(id(3 hDlg2))
ppDisp=d2_we3


#sub Dialog2
function# [hwndOwner] [~url]

str dd=
;BEGIN DIALOG
;0 "" 0x90CF0AC8 0x0 0 0 900 432 "Dialog2"
;3 ActiveX 0x54030000 0x0 0 0 900 432 "SHDocVw.WebBrowser {8856F961-340A-11D0-A96B-00C04FD705A2}"
;END DIALOG
;DIALOG EDITOR: "" 0x2040701 "*" "" "" ""

str controls = "3"
str ax3SHD
if(!empty(url))
,ax3SHD=url
ret ShowDialog(dd &sub.DlgProc2 &controls hwndOwner 1) ;;modeless dialog


#sub DlgProc2
function# hDlg message wParam lParam
int- t_hdlg

sel message
,case WM_INITDIALOG
,SHDocVw.WebBrowser we3
,we3._getcontrol(id(3 hDlg))
,we3._setevents("sub.we3")
,t_hdlg=hDlg
,DT_SetAutoSizeControls hDlg "3s"
,SetTimer hDlg 1 100 0
,case WM_TIMER
,sel wParam
,,case 1
,,int wies=child("" "Internet Explorer_Server" id(3 hDlg)); if(wies=0) ret
,,SetWindowSubclass(wies &sub.WndProc_Subclass 2 0)
,,KillTimer hDlg wParam
,case WM_DESTROY
,case WM_COMMAND goto messages2
,case WM_CLOSE
,DT_Ok(hDlg)
ret
;messages2
sel wParam
,case IDOK
,ifk(Y)
,,key Y           ;; Enter
,,ret 0
,case IDCANCEL
,ret 0
ret 1

#sub we3_WindowClosing
function @IsChildWindow @&Cancel ;;SHDocVw.IWebBrowser2'we3

Cancel=1
int- t_hdlg
clo t_hdlg

#sub FlashFullscreen
key F11
0.3
int w=win("" "ShockwaveFlashFullScreen")
wait 0 S "image:hDA7E4E62" w 0 1|16|0x400
lef
mou 0.5 0.5
;BEGIN PROJECT
;main_function  Macro2
;exe_file  $my qm$\Macro2.exe
;icon  <default>
;manifest  $qm$\default.exe.manifest
;flags  6
;guid  {7B7751DC-B224-44AF-9F51-4302F550E08F}
;END PROJECT

sel wParam
case 410
mac "sub.FlashFullscreen" ;;can I replace it directly with sub.FlashFullscreen ?  Huh
case IDOK
case IDCANCEL
ret 1
#14
i told you in earlier post

"Just keep in mind any url you add that will load flash will need to call SetTimer so the right click menu will work on the new page. If new url doesnt load flash you don't need to call SetTimer."


change code for case 2 to this and make sure you recompile function
Code:
Copy      Help
,,case 2
,,wb.Navigate("http://fs.focusky.com.cn/uxwbx/qbtq/index.html?flash")
,,SetTimer t_MhDlg 1 100 0

full code

Code:
Copy      Help
str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 900 432 "Dialog"
;4 ActiveX 0x54030000 0x0 0 0 900 432 "SHDocVw.WebBrowser {8856F961-340A-11D0-A96B-00C04FD705A2}"
;END DIALOG
;DIALOG EDITOR: "" 0x2040700 "*" "" "" ""

WebBrowserControlDisableIE7Emulation
str controls = "4"
str ax4SHD
ax4SHD="http://fs.focusky.com.cn/jhgh/tdzl/index.html"
if(!ShowDialog(dd &sub.DlgProc &controls)) ret

#sub DlgProc
function# hDlg message wParam lParam
int- t_MhDlg
sel message
,case WM_INITDIALOG
,DT_SetAccelerators hDlg "410 F10[]412 F12"
,SetTimer hDlg 1 100 0
,SHDocVw.WebBrowser we4
,we4._getcontrol(id(4 hDlg))
,we4._setevents("sub.we4")
,t_MhDlg=hDlg
,case WM_TIMER
,sel wParam
,,case 1
,,int wies=child("" "Internet Explorer_Server" id(4 hDlg)); if(wies=0) ret
,,SetWindowSubclass(wies &sub.WndProc_Subclass 2 0)
,,int mfpax2 mfpax=child("" "MacromediaFlashPlayerActiveX" id(4 hDlg));
,,if(mfpax!=0 and mfpax2!=mfpax)
,,,SetWindowSubclass(mfpax &sub.WndProc_Subclass 2 0)
,,,mfpax2=mfpax
,,else
,,,ret
,,KillTimer hDlg wParam
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case 410
,sub.FlashFullscreen
,case IDOK
,case IDCANCEL
ret 1

#sub WndProc_Subclass
function# hwnd message wParam lParam uIdSubclass dwRefData

;OutWinMsg message wParam lParam ;;uncomment to see received messages

sel message
,case WM_RBUTTONDOWN
,str s=
,;1 Change Main dialog url
,;2 swf 3
,;3 Yahoo
,;4 Bing
,;5 Quick Macros Forum
,
,MenuPopup x.AddItems(s)
,int i=x.Show
,int- t_MhDlg
,SHDocVw.WebBrowser wb
,wb._getcontrol(id(4 t_MhDlg))
,sel i
,,case 1
,,str url=wb.LocationURL
,,if url = "http://fs.focusky.com.cn/jhgh/tdzl/index.html"
,,,wb.Navigate("http://fs.focusky.com.cn/slgus/ybbt/index.html?flash")
,,else
,,,wb.Navigate("http://fs.focusky.com.cn/jhgh/tdzl/index.html")
,,SetTimer t_MhDlg 1 100 0
,,case 2
,,wb.Navigate("http://fs.focusky.com.cn/uxwbx/qbtq/index.html?flash")
,,SetTimer t_MhDlg 1 100 0
,,case 3
,,wb.Navigate("https://www.yahoo.com")
,,case 4
,,wb.Navigate("https://www.bing.com")
,,case 5
,,wb.Navigate("http://www.quickmacros.com/forum")
,ret

int R=DefSubclassProc(hwnd message wParam lParam)

sel message
,case WM_NCDESTROY
,RemoveWindowSubclass(hwnd &sub.WndProc_Subclass uIdSubclass)
,
,;case ...

ret R

#sub we4_NewWindow3
function IDispatch&ppDisp @&Cancel dwFlags BSTR'bstrUrlContext BSTR'bstrUrl SHDocVw.IWebBrowser2'we3

int hDlg2=sub.Dialog2
SHDocVw.WebBrowser d2_we3._getcontrol(id(3 hDlg2))
ppDisp=d2_we3


#sub Dialog2
function# [hwndOwner] [~url]

str dd=
;BEGIN DIALOG
;0 "" 0x90CF0AC8 0x0 0 0 900 432 "Dialog2"
;3 ActiveX 0x54030000 0x0 0 0 900 432 "SHDocVw.WebBrowser {8856F961-340A-11D0-A96B-00C04FD705A2}"
;END DIALOG
;DIALOG EDITOR: "" 0x2040701 "*" "" "" ""

str controls = "3"
str ax3SHD
if(!empty(url))
,ax3SHD=url
ret ShowDialog(dd &sub.DlgProc2 &controls hwndOwner 1) ;;modeless dialog


#sub DlgProc2
function# hDlg message wParam lParam
int- t_hdlg

sel message
,case WM_INITDIALOG
,SHDocVw.WebBrowser we3
,we3._getcontrol(id(3 hDlg))
,we3._setevents("sub.we3")
,t_hdlg=hDlg
,DT_SetAutoSizeControls hDlg "3s"
,SetTimer hDlg 1 100 0
,case WM_TIMER
,sel wParam
,,case 1
,,int wies=child("" "Internet Explorer_Server" id(3 hDlg)); if(wies=0) ret
,,SetWindowSubclass(wies &sub.WndProc_Subclass 2 0)
,,KillTimer hDlg wParam
,case WM_DESTROY
,case WM_COMMAND goto messages2
,case WM_CLOSE
,DT_Ok(hDlg)
ret
;messages2
sel wParam
,case IDOK
,ifk(Y)
,,key Y           ;; Enter
,,ret 0
,case IDCANCEL
,ret 0
ret 1

#sub we3_WindowClosing
function @IsChildWindow @&Cancel ;;SHDocVw.IWebBrowser2'we3

Cancel=1
int- t_hdlg
clo t_hdlg

#sub FlashFullscreen
key F11 
0.3
int w=win("" "ShockwaveFlashFullScreen")
scan "image:h2F7BFF9D" w 0 1|2|16
lef
mou 0.5 0.5
key L           ;; Left
#15
Thanks again for your reminder, about the second dialog, I deleted it, the code won't run, but I don't understand why I need to add it.
#16
What second dialog?
#17
I added a new quick key alt+a but it doesn't work. Huh


Macro Macro3
Code:
Copy      Help
str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 900 432 "Dialog"
;4 ActiveX 0x54030000 0x0 0 0 900 432 "SHDocVw.WebBrowser {8856F961-340A-11D0-A96B-00C04FD705A2}"
;END DIALOG
;DIALOG EDITOR: "" 0x2040700 "*" "" "" ""

WebBrowserControlDisableIE7Emulation
str controls = "4"
str ax4SHD
ax4SHD="http://fs.focusky.com.cn/jhgh/tdzl/index.html"
if(!ShowDialog(dd &sub.DlgProc &controls)) ret

#sub DlgProc
function# hDlg message wParam lParam
int- t_MhDlg
sel message
,case WM_INITDIALOG
,DT_SetAccelerators hDlg "410 F10[]411 Aa[]412 F12"
,SetTimer hDlg 1 100 0
,SHDocVw.WebBrowser we4
,we4._getcontrol(id(4 hDlg))
,we4._setevents("sub.we4")
,t_MhDlg=hDlg
,case WM_TIMER
,sel wParam
,,case 1
,,int wies=child("" "Internet Explorer_Server" id(4 hDlg)); if(wies=0) ret
,,SetWindowSubclass(wies &sub.WndProc_Subclass 2 0)
,,int mfpax2 mfpax=child("" "MacromediaFlashPlayerActiveX" id(4 hDlg));
,,if(mfpax!=0 and mfpax2!=mfpax)
,,,SetWindowSubclass(mfpax &sub.WndProc_Subclass 2 0)
,,,mfpax2=mfpax
,,else
,,,ret
,,KillTimer hDlg wParam
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case 410
,sub.FlashFullscreen
,case 411
,sub.FlashFullscreen
,case IDOK
,case IDCANCEL
ret 1

#sub WndProc_Subclass
function# hwnd message wParam lParam uIdSubclass dwRefData

;OutWinMsg message wParam lParam ;;uncomment to see received messages

sel message
,case WM_RBUTTONDOWN
,str s=
,;1 Change Main dialog url
,;2 swf 3
,;3 Yahoo
,;4 Bing
,;5 Quick Macros Forum
,
,MenuPopup x.AddItems(s)
,int i=x.Show
,int- t_MhDlg
,SHDocVw.WebBrowser wb
,wb._getcontrol(id(4 t_MhDlg))
,sel i
,,case 1
,,str url=wb.LocationURL
,,if url = "http://fs.focusky.com.cn/jhgh/tdzl/index.html"
,,,wb.Navigate("http://fs.focusky.com.cn/slgus/ybbt/index.html?flash")
,,else
,,,wb.Navigate("http://fs.focusky.com.cn/jhgh/tdzl/index.html")
,,SetTimer t_MhDlg 1 100 0
,,case 2
,,wb.Navigate("http://fs.focusky.com.cn/uxwbx/qbtq/index.html?flash")
,,SetTimer t_MhDlg 1 100 0
,,case 3
,,wb.Navigate("https://www.yahoo.com")
,,case 4
,,wb.Navigate("https://www.bing.com")
,,case 5
,,wb.Navigate("http://www.quickmacros.com/forum")
,ret

int R=DefSubclassProc(hwnd message wParam lParam)

sel message
,case WM_NCDESTROY
,RemoveWindowSubclass(hwnd &sub.WndProc_Subclass uIdSubclass)
,
,;case ...

ret R

#sub we4_NewWindow3
function IDispatch&ppDisp @&Cancel dwFlags BSTR'bstrUrlContext BSTR'bstrUrl SHDocVw.IWebBrowser2'we3

int hDlg2=sub.Dialog2
SHDocVw.WebBrowser d2_we3._getcontrol(id(3 hDlg2))
ppDisp=d2_we3


#sub Dialog2
function# [hwndOwner] [~url]

str dd=
;BEGIN DIALOG
;0 "" 0x90CF0AC8 0x0 0 0 900 432 "Dialog2"
;3 ActiveX 0x54030000 0x0 0 0 900 432 "SHDocVw.WebBrowser {8856F961-340A-11D0-A96B-00C04FD705A2}"
;END DIALOG
;DIALOG EDITOR: "" 0x2040701 "*" "" "" ""

str controls = "3"
str ax3SHD
if(!empty(url))
,ax3SHD=url
ret ShowDialog(dd &sub.DlgProc2 &controls hwndOwner 1) ;;modeless dialog


#sub DlgProc2
function# hDlg message wParam lParam
int- t_hdlg

sel message
,case WM_INITDIALOG
,SHDocVw.WebBrowser we3
,we3._getcontrol(id(3 hDlg))
,we3._setevents("sub.we3")
,t_hdlg=hDlg
,DT_SetAutoSizeControls hDlg "3s"
,SetTimer hDlg 1 100 0
,case WM_TIMER
,sel wParam
,,case 1
,,int wies=child("" "Internet Explorer_Server" id(3 hDlg)); if(wies=0) ret
,,SetWindowSubclass(wies &sub.WndProc_Subclass 2 0)
,,KillTimer hDlg wParam
,case WM_DESTROY
,case WM_COMMAND goto messages2
,case WM_CLOSE
,DT_Ok(hDlg)
ret
;messages2
sel wParam
,case IDOK
,ifk(Y)
,,key Y           ;; Enter
,,ret 0
,case IDCANCEL
,ret 0
ret 1

#sub we3_WindowClosing
function @IsChildWindow @&Cancel ;;SHDocVw.IWebBrowser2'we3

Cancel=1
int- t_hdlg
clo t_hdlg

#sub FlashFullscreen
key F11
0.3
int w=win("" "ShockwaveFlashFullScreen")
scan "image:h2F7BFF9D" w 0 1|2|16
lef
mou 0.5 0.5
key L           ;; Left


Attached Files Image(s)
   
#18
that's not how you call the second dialog
#19
My original thoughts:

1. All web pages containing swf are all displayed in the main dialog

2. The second dialog contains buttons, click the button: switch page

3. The right-click menu and the second dialog are essentially the same,  the operation is different.
#20
the second dialog that you left in there is for a modal window remember you used it in other things

the right click menu switches pages just fine to open a url in the second dialog window do this


Code:
Copy      Help
str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 900 432 "Dialog"
;4 ActiveX 0x54030000 0x0 0 0 900 432 "SHDocVw.WebBrowser {8856F961-340A-11D0-A96B-00C04FD705A2}"
;END DIALOG
;DIALOG EDITOR: "" 0x2040700 "*" "" "" ""

WebBrowserControlDisableIE7Emulation
str controls = "4"
str ax4SHD
ax4SHD="http://fs.focusky.com.cn/jhgh/tdzl/index.html"
if(!ShowDialog(dd &sub.DlgProc &controls)) ret

#sub DlgProc
function# hDlg message wParam lParam
int- t_MhDlg
sel message
,case WM_INITDIALOG
,DT_SetAccelerators hDlg "410 F10[]412 F12"
,SetTimer hDlg 1 100 0
,SHDocVw.WebBrowser we4
,we4._getcontrol(id(4 hDlg))
,we4._setevents("sub.we4")
,t_MhDlg=hDlg
,case WM_TIMER
,sel wParam
,,case 1
,,int wies=child("" "Internet Explorer_Server" id(4 hDlg)); if(wies=0) ret
,,SetWindowSubclass(wies &sub.WndProc_Subclass 2 0)
,,int mfpax2 mfpax=child("" "MacromediaFlashPlayerActiveX" id(4 hDlg));
,,if(mfpax!=0 and mfpax2!=mfpax)
,,,SetWindowSubclass(mfpax &sub.WndProc_Subclass 2 0)
,,,mfpax2=mfpax
,,else
,,,ret
,,KillTimer hDlg wParam
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case 410
,sub.FlashFullscreen
,case IDOK
,case IDCANCEL
ret 1

#sub WndProc_Subclass
function# hwnd message wParam lParam uIdSubclass dwRefData

;OutWinMsg message wParam lParam ;;uncomment to see received messages

sel message
,case WM_RBUTTONDOWN
,str s=
,;1 Change Main dialog url
,;> swf 3
,;,2 open swf 3 in Main
,;,200 open swf 3 in New
,;<
,;3 Yahoo
,;4 Bing
,;5 Quick Macros Forum
,
,MenuPopup x.AddItems(s)
,int i=x.Show
,int- t_MhDlg
,SHDocVw.WebBrowser wb
,wb._getcontrol(id(4 t_MhDlg))
,sel i
,,case 1
,,str url=wb.LocationURL
,,if url = "http://fs.focusky.com.cn/jhgh/tdzl/index.html"
,,,wb.Navigate("http://fs.focusky.com.cn/slgus/ybbt/index.html?flash")
,,else
,,,wb.Navigate("http://fs.focusky.com.cn/jhgh/tdzl/index.html")
,,SetTimer t_MhDlg 1 100 0
,,case 2
,,wb.Navigate("http://fs.focusky.com.cn/uxwbx/qbtq/index.html?flash")
,,SetTimer t_MhDlg 1 100 0
,,case 3
,,wb.Navigate("https://www.yahoo.com")
,,case 4
,,wb.Navigate("https://www.bing.com")
,,case 5
,,wb.Navigate("http://www.quickmacros.com/forum")
,,case 200
,,sub.Dialog2(hwnd "http://fs.focusky.com.cn/uxwbx/qbtq/index.html?flash")
,ret

int R=DefSubclassProc(hwnd message wParam lParam)

sel message
,case WM_NCDESTROY
,RemoveWindowSubclass(hwnd &sub.WndProc_Subclass uIdSubclass)
,
,;case ...

ret R

#sub we4_NewWindow3
function IDispatch&ppDisp @&Cancel dwFlags BSTR'bstrUrlContext BSTR'bstrUrl SHDocVw.IWebBrowser2'we3

int hDlg2=sub.Dialog2
SHDocVw.WebBrowser d2_we3._getcontrol(id(3 hDlg2))
ppDisp=d2_we3


#sub Dialog2
function# [hwndOwner] [~url]

str dd=
;BEGIN DIALOG
;0 "" 0x90CF0AC8 0x0 0 0 900 432 "Dialog2"
;3 ActiveX 0x54030000 0x0 0 0 900 432 "SHDocVw.WebBrowser {8856F961-340A-11D0-A96B-00C04FD705A2}"
;END DIALOG
;DIALOG EDITOR: "" 0x2040701 "*" "" "" ""

str controls = "3"
str ax3SHD
if(!empty(url))
,ax3SHD=url
ret ShowDialog(dd &sub.DlgProc2 &controls hwndOwner 1) ;;modeless dialog


#sub DlgProc2
function# hDlg message wParam lParam
int- t_hdlg

sel message
,case WM_INITDIALOG
,SHDocVw.WebBrowser we3
,we3._getcontrol(id(3 hDlg))
,we3._setevents("sub.we3")
,t_hdlg=hDlg
,DT_SetAutoSizeControls hDlg "3s"
,SetTimer hDlg 1 100 0
,case WM_TIMER
,sel wParam
,,case 1
,,int wies=child("" "Internet Explorer_Server" id(3 hDlg)); if(wies=0) ret
,,SetWindowSubclass(wies &sub.WndProc_Subclass 2 0)
,,int mfpax2 mfpax=child("" "MacromediaFlashPlayerActiveX" id(3 hDlg));
,,if(mfpax!=0 and mfpax2!=mfpax)
,,,SetWindowSubclass(mfpax &sub.WndProc_Subclass 2 0)
,,,mfpax2=mfpax        
,,KillTimer hDlg wParam
,case WM_DESTROY
,case WM_COMMAND goto messages2
,case WM_CLOSE
,DT_Ok(hDlg)
ret
;messages2
sel wParam
,case IDOK
,ifk(Y)
,,key Y           ;; Enter
,,ret 0
,case IDCANCEL
,ret 0
ret 1

#sub we3_WindowClosing
function @IsChildWindow @&Cancel ;;SHDocVw.IWebBrowser2'we3

Cancel=1
int- t_hdlg
clo t_hdlg

#sub FlashFullscreen
key F11 
;0.3
int w=win("" "ShockwaveFlashFullScreen")
scan "image:h2F7BFF9D" w 0 1|2|16
lef
mou 0.5 0.5
key L           ;; Left
swf 3 can be open in main or a new window now
#21
Yes, I also remembered, the second dialog is a child window.

Define the hotkey alt+a to execute the same command as F10, still not solved

I still have a problem. When I open a web page from a child window, only one status icon is displayed on the taskbar. It should be two. Huh
#22
that window won't show in taskbar

Alt+A wont work cause its used by Internet explorer

#23
Some programming knowledge is not very understandable, such as timer

I use QM now, often using recording actions.

I just tried it, and Alt and any key combination can't execute the code properly.

For example: alt+1 alt+F1 alt+o alt+p ......
#24
posting this here cause some code seemed to have got mixed up everything in this works for all up to this point F10 is still the hotkey for fullscreen Flash

Function swf_menu2
Code:
Copy      Help
str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 900 432 "Dialog"
;4 ActiveX 0x54030000 0x0 0 0 900 432 "SHDocVw.WebBrowser {8856F961-340A-11D0-A96B-00C04FD705A2}"
;END DIALOG
;DIALOG EDITOR: "" 0x2040700 "*" "" "" ""

WebBrowserControlDisableIE7Emulation
str controls = "4"
str ax4SHD
ax4SHD="http://fs.focusky.com.cn/jhgh/tdzl/index.html"
if(!ShowDialog(dd &sub.DlgProc &controls)) ret

#sub DlgProc
function# hDlg message wParam lParam
int- t_MhDlg
sel message
,case WM_INITDIALOG
,DT_SetAccelerators hDlg "410 F10[]412 F12"
,SetTimer hDlg 1 100 0
,SHDocVw.WebBrowser we4
,we4._getcontrol(id(4 hDlg))
,we4._setevents("sub.we4")
,t_MhDlg=hDlg
,case WM_TIMER
,sel wParam
,,case 1
,,int wies=child("" "Internet Explorer_Server" id(4 hDlg)); if(wies=0) ret
,,SetWindowSubclass(wies &sub.WndProc_Subclass 2 0)
,,int mfpax2 mfpax=child("" "MacromediaFlashPlayerActiveX" id(4 hDlg));
,,if(mfpax!=0 and mfpax2!=mfpax)
,,,SetWindowSubclass(mfpax &sub.WndProc_Subclass 2 0)
,,,mfpax2=mfpax
,,else
,,,ret
,,KillTimer hDlg wParam
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case 410
,sub.FlashFullscreen
,case IDOK
,case IDCANCEL
ret 1

#sub WndProc_Subclass
function# hwnd message wParam lParam uIdSubclass dwRefData

;OutWinMsg message wParam lParam ;;uncomment to see received messages

sel message
,case WM_RBUTTONDOWN
,str s=
,;1 Change Main dialog url
,;> swf 3
,;,2 open swf 3 in Main
,;,200 open swf 3 in New
,;<
,;3 Yahoo
,;4 Bing
,;5 Quick Macros Forum
,
,MenuPopup x.AddItems(s)
,int i=x.Show
,int- t_MhDlg
,SHDocVw.WebBrowser wb
,wb._getcontrol(id(4 t_MhDlg))
,sel i
,,case 1
,,str url=wb.LocationURL
,,if url = "http://fs.focusky.com.cn/jhgh/tdzl/index.html"
,,,wb.Navigate("http://fs.focusky.com.cn/slgus/ybbt/index.html?flash")
,,else
,,,wb.Navigate("http://fs.focusky.com.cn/jhgh/tdzl/index.html")
,,SetTimer t_MhDlg 1 100 0
,,case 2
,,wb.Navigate("http://fs.focusky.com.cn/uxwbx/qbtq/index.html?flash")
,,SetTimer t_MhDlg 1 100 0
,,case 3
,,wb.Navigate("https://www.yahoo.com")
,,case 4
,,wb.Navigate("https://www.bing.com")
,,case 5
,,wb.Navigate("http://www.quickmacros.com/forum")
,,case 200
,,sub.Dialog2(hwnd "http://fs.focusky.com.cn/uxwbx/qbtq/index.html?flash")
,ret

int R=DefSubclassProc(hwnd message wParam lParam)

sel message
,case WM_NCDESTROY
,RemoveWindowSubclass(hwnd &sub.WndProc_Subclass uIdSubclass)
,
,;case ...

ret R

#sub we4_NewWindow3
function IDispatch&ppDisp @&Cancel dwFlags BSTR'bstrUrlContext BSTR'bstrUrl SHDocVw.IWebBrowser2'we3

int hDlg2=sub.Dialog2
SHDocVw.WebBrowser d2_we3._getcontrol(id(3 hDlg2))
ppDisp=d2_we3


#sub Dialog2
function# [hwndOwner] [~url]

str dd=
;BEGIN DIALOG
;0 "" 0x90CF0AC8 0x0 0 0 900 432 "Dialog2"
;3 ActiveX 0x54030000 0x0 0 0 900 432 "SHDocVw.WebBrowser {8856F961-340A-11D0-A96B-00C04FD705A2}"
;END DIALOG
;DIALOG EDITOR: "" 0x2040701 "*" "" "" ""

str controls = "3"
str ax3SHD
if(!empty(url))
,ax3SHD=url
ret ShowDialog(dd &sub.DlgProc2 &controls hwndOwner 1) ;;modeless dialog


#sub DlgProc2
function# hDlg message wParam lParam
int- t_hdlg

sel message
,case WM_INITDIALOG
,SHDocVw.WebBrowser we3
,we3._getcontrol(id(3 hDlg))
,we3._setevents("sub.we3")
,t_hdlg=hDlg
,DT_SetAutoSizeControls hDlg "3s"
,SetTimer hDlg 1 100 0
,case WM_TIMER
,sel wParam
,,case 1
,,int wies=child("" "Internet Explorer_Server" id(3 hDlg)); if(wies=0) ret
,,SetWindowSubclass(wies &sub.WndProc_Subclass 2 0)
,,int mfpax2 mfpax=child("" "MacromediaFlashPlayerActiveX" id(3 hDlg));
,,if(mfpax!=0 and mfpax2!=mfpax)
,,,SetWindowSubclass(mfpax &sub.WndProc_Subclass 2 0)
,,,mfpax2=mfpax
,,KillTimer hDlg wParam
,case WM_DESTROY
,case WM_COMMAND goto messages2
,case WM_CLOSE
,DT_Ok(hDlg)
ret
;messages2
sel wParam
,case IDOK
,ifk(Y)
,,key Y           ;; Enter
,,ret 0
,case IDCANCEL
,ret 0
ret 1

#sub we3_WindowClosing
function @IsChildWindow @&Cancel ;;SHDocVw.IWebBrowser2'we3

Cancel=1
int- t_hdlg
clo t_hdlg

#sub FlashFullscreen
key F11
0.3
int w=win("" "ShockwaveFlashFullScreen")
wait 0 S "image:h2F7BFF9D" w 0 1|2|16
lef
mou 0.5 0.5
key L           ;; Left

   
#25
Open swf in the child window, F10 has no effect
#26
of course not wasn't programmed lol
#27
I copied the hotkey code in the main window to the child window and it will be fine.

Is there an easier way?


Forum Jump:


Users browsing this thread: 1 Guest(s)