Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Cannot disable right-click menu
#1
hello,
The same QM code, different web addresses, the first one can disable the right-click menu, the other can not  Huh 

Macro Cannot dis
Code:
Copy      Help
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
#2
this seems to work subclass the MacromediaFlashPlayerActiveX control as well

Function Function520
Code:
Copy      Help
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
#3
@kevin

You gave me a lot of help, Thank you very much.  Heart

Can you give me a few ways to improve my programming skills quickly?

For example: entry-level programming books, programming newbie forums…… etc.  Smile

It's a little strange , I opened the quiz from my local web page and still can't use the custom right click menu   Huh


Macro No
Code:
Copy      Help
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
.zip   test.zip (Size: 865.86 KB / Downloads: 323)
#4
It creates another MacromediaFlashPlayerActiveX object so the dialog doesn't have the handle to it once you click open quiz.
#5
Is there another way to solve this problem?   Smile
#6
try this 



Code:
Copy      Help
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
Code:
Copy      Help
int w=wait(600 WV win("Dialog" "#32770"))
Acc a.Find(w "CLIENT" "" "a:id=sf" 0x3004 600)
SetTimer w 1 100 0
#7
Successful, thank you very much. Heart

Your programming skills are too strong Tongue
#8
better way 
Function Function29
Code:
Copy      Help
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
#9
Code:
Copy      Help
#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  Undecided
#10
use this code instead
http://www.quickmacros.com/forum/showthr...5#pid31365

the code your referring to is not needed forgot to remove
#11
Can only take effect once  Huh

When I have more than one quiz, I can't succeed. I uploaded a new file


Attached Files
.zip   test2.zip (Size: 887.27 KB / Downloads: 329)
#12
this should work for multiple quiz files
Function Function29
Code:
Copy      Help
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
Code:
Copy      Help
function hwnd hdlg
int w1=wait(0 -WV hwnd)
SetTimer hdlg 1 100 0
#13
Successful test, thank you very much Heart


Forum Jump:


Users browsing this thread: 3 Guest(s)