Posts: 726
Threads: 99
Joined: Mar 2018
05-19-2018, 12:25 AM
(This post was last modified: 05-19-2018, 12:27 AM by win .)
hello,
The same QM code, different web addresses, the first one can disable the right-click menu, the other can not
Macro
Cannot dis
str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 724 376 "Dialog"
;4 ActiveX 0x54030000 0x0 0 0 724 376 "SHDocVw.WebBrowser {8856F961-340A-11D0-A96B-00C04FD705A2}"
;END DIALOG
;DIALOG EDITOR: "" 0x2040700 "*" "" "" ""
str controls = "4"
str ax4SHD
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.Navigate("http://static.flipbuilder.com/demo/sysco-seafood/index.html#p=1") ;;Can display customize right-click menu
, we4.Navigate ( "http://fs.focusky.com.cn/jhgh/vapp/files/extfiles/ext_201851908834294.html" ) ;;Cannot show customize right-click menu
, 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 )
,, 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 Text
, ;-
, ;2 Text
, ;>Submenu
, ;,Text
, ;,Text
, ;,<
, MenuPopup x.AddItems ( s)
, int i= x.Show
, sel i
,, case 1
,, mes "1"
, ret
int R= DefSubclassProc ( hwnd message wParam lParam)
sel message
, case WM_NCDESTROY
, RemoveWindowSubclass ( hwnd & sub.WndProc_Subclass uIdSubclass)
,
, ;case ...
ret R
;BEGIN PROJECT
;main_function Cannot dis
;exe_file $my qm$\Cannot dis.exe
;icon <default>
;manifest $qm$\default.exe.manifest
;flags 6
;guid {1C2E812B-3466-43B8-B79E-5DFCBB2AEC5A}
;END PROJECT
Posts: 1,336
Threads: 61
Joined: Jul 2006
05-19-2018, 12:50 AM
(This post was last modified: 05-19-2018, 01:26 AM by Kevin .)
this seems to work subclass the MacromediaFlashPlayerActiveX control as well
Function
Function520
str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 724 376 "Dialog"
;4 ActiveX 0x54030000 0x0 0 0 724 376 "SHDocVw.WebBrowser {8856F961-340A-11D0-A96B-00C04FD705A2}"
;END DIALOG
;DIALOG EDITOR: "" 0x2040700 "*" "" "" ""
str controls = "4"
str ax4SHD
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.Navigate("http://static.flipbuilder.com/demo/sysco-seafood/index.html#p=1") ;;Can display customize right-click menu
, we4.Navigate ( "http://fs.focusky.com.cn/jhgh/vapp/files/extfiles/ext_201851908834294.html" ) ;;Cannot show customize right-click menu
, 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 mfpax= child ( "" "MacromediaFlashPlayerActiveX" id ( 4 hDlg));
,, if ( mfpax!= 0 )
,,, SetWindowSubclass ( mfpax & sub.WndProc_Subclass 2 0 )
,, 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 Text
, ;-
, ;2 Text
, ;>Submenu
, ;,Text
, ;,Text
, ;,<
, MenuPopup x.AddItems ( s)
, int i= x.Show
, sel i
,, case 1
,, mes "1"
, ret
int R= DefSubclassProc ( hwnd message wParam lParam)
sel message
, case WM_NCDESTROY
, RemoveWindowSubclass ( hwnd & sub.WndProc_Subclass uIdSubclass)
,
, ;case ...
ret R
;BEGIN PROJECT
;main_function Cannot dis
;exe_file $my qm$\Cannot dis.exe
;icon <default>
;manifest $qm$\default.exe.manifest
;flags 6
;guid {1C2E812B-3466-43B8-B79E-5DFCBB2AEC5A}
;END PROJECT
Posts: 726
Threads: 99
Joined: Mar 2018
05-19-2018, 02:43 AM
(This post was last modified: 05-19-2018, 03:16 AM by win .)
@kevin
You gave me a lot of help, Thank you very much.
Can you give me a few ways to improve my programming skills quickly?
For example: entry-level programming books, programming newbie forums…… etc.
It's a little strange , I opened the quiz from my local web page and still can't use the custom right click menu
Macro
No
str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 724 376 "Dialog"
;4 ActiveX 0x54030000 0x0 0 0 724 376 "SHDocVw.WebBrowser {8856F961-340A-11D0-A96B-00C04FD705A2}"
;END DIALOG
;DIALOG EDITOR: "" 0x2040700 "*" "" "" ""
str controls = "4"
str ax4SHD
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.Navigate("http://static.flipbuilder.com/demo/sysco-seafood/index.html#p=1")
, ;we4.Navigate("http://fs.focusky.com.cn/jhgh/vapp/files/extfiles/ext_201851908834294.html")
, we4.Navigate ( _s.expandpath ( "$desktop$\test\index.html" ))
, 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 mfpax= child ( "" "MacromediaFlashPlayerActiveX" id ( 4 hDlg));
,, if ( mfpax!= 0 )
,,, SetWindowSubclass ( mfpax & sub.WndProc_Subclass 2 0 )
,, 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 Text
, ;-
, ;2 Text
, ;>Submenu
, ;,Text
, ;,Text
, ;,<
, MenuPopup x.AddItems ( s)
, int i= x.Show
, sel i
,, case 1
,, mes "1"
, ret
int R= DefSubclassProc ( hwnd message wParam lParam)
sel message
, case WM_NCDESTROY
, RemoveWindowSubclass ( hwnd & sub.WndProc_Subclass uIdSubclass)
,
, ;case ...
ret R
Attached Files
test.zip (Size: 865.86 KB / Downloads: 323)
Posts: 1,336
Threads: 61
Joined: Jul 2006
It creates another MacromediaFlashPlayerActiveX object so the dialog doesn't have the handle to it once you click open quiz.
Posts: 726
Threads: 99
Joined: Mar 2018
Is there another way to solve this problem?
Posts: 1,336
Threads: 61
Joined: Jul 2006
try this
str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 724 376 "Dialog"
;4 ActiveX 0x54030000 0x0 0 0 724 376 "SHDocVw.WebBrowser {8856F961-340A-11D0-A96B-00C04FD705A2}"
;END DIALOG
;DIALOG EDITOR: "" 0x2040700 "*" "" "" ""
WebBrowserControlDisableIE7Emulation
str controls = "4"
str ax4SHD
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.Navigate("http://static.flipbuilder.com/demo/sysco-seafood/index.html#p=1")
, ;we4.Navigate("http://fs.focusky.com.cn/jhgh/vapp/files/extfiles/ext_201851908834294.html")
, we4.Navigate ( _s.expandpath ( "$desktop$\test\index.html" ))
, 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
,,, mac "testfunc"
,, 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 Text
, ;-
, ;2 Text
, ;>Submenu
, ;,Text
, ;,Text
, ;,<
, MenuPopup x.AddItems ( s)
, int i= x.Show
, sel i
,, case 1
,, mes "1"
, ret
int R= DefSubclassProc ( hwnd message wParam lParam)
sel message
, case WM_NCDESTROY
, RemoveWindowSubclass ( hwnd & sub.WndProc_Subclass uIdSubclass)
,
, ;case ...
ret R
#sub Window_check
int w= wait ( 600 WV win ( "Dialog" "#32770" ))
Acc a.Find ( w "CLIENT" "" "a:id=sf" 0x3004 600 )
SetTimer w 1 100 0
Function
testfunc
int w= wait ( 600 WV win ( "Dialog" "#32770" ))
Acc a.Find ( w "CLIENT" "" "a:id=sf" 0x3004 600 )
SetTimer w 1 100 0
Posts: 726
Threads: 99
Joined: Mar 2018
Successful, thank you very much.
Your programming skills are too strong
Posts: 1,336
Threads: 61
Joined: Jul 2006
05-19-2018, 04:57 AM
(This post was last modified: 05-19-2018, 05:11 AM by Kevin .)
better way
Function
Function29
str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 724 376 "Dialog"
;4 ActiveX 0x54030000 0x0 0 0 724 376 "SHDocVw.WebBrowser {8856F961-340A-11D0-A96B-00C04FD705A2}"
;END DIALOG
;DIALOG EDITOR: "" 0x2040700 "*" "" "" ""
WebBrowserControlDisableIE7Emulation
str controls = "4"
str ax4SHD
if ( ! ShowDialog ( dd & sub.DlgProc & controls)) ret
#sub DlgProc
function # hDlg message wParam lParam
int - mfpax2 mfpax3 mfpax
sel message
, case WM_INITDIALOG
, SetTimer hDlg 1 100 0
, SHDocVw. WebBrowser we4
, we4._getcontrol ( id ( 4 hDlg))
, ;we4.Navigate("http://static.flipbuilder.com/demo/sysco-seafood/index.html#p=1")
, ;we4.Navigate("http://fs.focusky.com.cn/jhgh/vapp/files/extfiles/ext_201851908834294.html")
, we4.Navigate ( _s.expandpath ( "$desktop$\test\index.html" ))
, 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 )
,, 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
,, SetTimer hDlg 2 100 0
,, case 2
,, mfpax3= child ( "" "MacromediaFlashPlayerActiveX" id ( 4 hDlg));
,, if ( mfpax3!= 0 and mfpax2!= mfpax3)
,,, SetWindowSubclass ( mfpax3 & sub.WndProc_Subclass 2 0 )
,, 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 Text
, ;-
, ;2 Text
, ;>Submenu
, ;,Text
, ;,Text
, ;,<
, MenuPopup x.AddItems ( s)
, int i= x.Show
, sel i
,, case 1
,, mes "1"
, ret
int R= DefSubclassProc ( hwnd message wParam lParam)
sel message
, case WM_NCDESTROY
, RemoveWindowSubclass ( hwnd & sub.WndProc_Subclass uIdSubclass)
,
, ;case ...
ret R
Posts: 726
Threads: 99
Joined: Mar 2018
#sub Window_check
int w=wait(600 WV win("dialog" "#32770"))
Acc a.Find(w "CLIENT" "" "a:id=sf" 0x3004 600)
SetTimer w 1 100 0
This code can be deleted?
I test, write in a file, the program will crash
Posts: 1,336
Threads: 61
Joined: Jul 2006
05-19-2018, 05:32 AM
(This post was last modified: 05-19-2018, 05:35 AM by Kevin .)
use this code instead
http://www.quickmacros.com/forum/showthr...5#pid31365
the code your referring to is not needed forgot to remove
Posts: 726
Threads: 99
Joined: Mar 2018
Can only take effect once
When I have more than one quiz, I can't succeed. I uploaded a new file
Attached Files
test2.zip (Size: 887.27 KB / Downloads: 329)
Posts: 1,336
Threads: 61
Joined: Jul 2006
this should work for multiple quiz files
Function
Function29
str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 724 376 "Dialog"
;4 ActiveX 0x54030000 0x0 0 0 724 376 "SHDocVw.WebBrowser {8856F961-340A-11D0-A96B-00C04FD705A2}"
;END DIALOG
;DIALOG EDITOR: "" 0x2040700 "*" "" "" ""
WebBrowserControlDisableIE7Emulation
str controls = "4"
str ax4SHD
if ( ! ShowDialog ( dd & sub.DlgProc & controls)) ret
#sub DlgProc
function # hDlg message wParam lParam
;int- mfpax2 mfpax3 mfpax
sel message
, case WM_INITDIALOG
, SetTimer hDlg 1 100 0
, SHDocVw. WebBrowser we4
, we4._getcontrol ( id ( 4 hDlg))
, ;we4.Navigate("http://static.flipbuilder.com/demo/sysco-seafood/index.html#p=1")
, ;we4.Navigate("http://fs.focusky.com.cn/jhgh/vapp/files/extfiles/ext_201851908834294.html")
, we4.Navigate ( _s.expandpath ( "$desktop$\test\index.html" ))
, 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 "testfunc" "" 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 Text
, ;-
, ;2 Text
, ;>Submenu
, ;,Text
, ;,Text
, ;,<
, MenuPopup x.AddItems ( s)
, int i= x.Show
, sel i
,, case 1
,, mes "1"
, ret
int R= DefSubclassProc ( hwnd message wParam lParam)
sel message
, case WM_NCDESTROY
, RemoveWindowSubclass ( hwnd & sub.WndProc_Subclass uIdSubclass)
,
, ;case ...
ret R
Function
testfunc
function hwnd hdlg
int w1= wait ( 0 - WV hwnd)
SetTimer hdlg 1 100 0
Posts: 726
Threads: 99
Joined: Mar 2018
Successful test, thank you very much