Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Disable right click on SHDocVw.WebBrowser?
#2
just need to subclass the control and catch the right click event
 
Code:
Copy      Help
str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 224 136 "Dialog" "4"
;1 Button 0x54030001 0x4 116 116 48 14 "OK"
;2 Button 0x54030000 0x4 168 116 48 14 "Cancel"
;3 ActiveX 0x54030000 0x0 10 9 200 101 "SHDocVw.WebBrowser"
;END DIALOG
;DIALOG EDITOR: "" 0x2040A00 "*" "" "" ""

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


#sub DlgProc
function# hDlg message wParam lParam

sel message
,case WM_INITDIALOG
,;SHDocVw.WebBrowser we3
,;we3._getcontrol(id(3 hDlg))
,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 3 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
,out "right click disabled"
,ret

int R=DefSubclassProc(hwnd message wParam lParam)

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

ret R


Messages In This Thread
RE: Disable right click on SHDocVw.WebBrowser? - by Kevin - 02-19-2021, 01:29 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)