Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Detect a click on a SHDocVw control within a QM dialog
#1
Is it possible to detect a click (left/right/mid) on SHDocVw control within a QM dialog?
(A click on any part within the shdocvw control, meaning: scrollbar, sort columns,...etc...)

Function detect_click_on_shdoc
Code:
Copy      Help
str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 224 136 "Dialog"
;3 ActiveX 0x54000000 0x0 5 5 210 119 "SHDocVw.WebBrowser"
;END DIALOG
;DIALOG EDITOR: "" 0x2040601 "*" "" "" ""

str controls = "3"
str ax3SHD
ax3SHD="d:\"
if(!ShowDialog(dd &sub.DlgProc &controls)) 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
ret 1
#2
Macro Macro412
Code:
Copy      Help
str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 224 136 "Dialog"
;3 ActiveX 0x54000000 0x0 5 5 210 119 "SHDocVw.WebBrowser"
;END DIALOG
;DIALOG EDITOR: "" 0x2040601 "*" "" "" ""

str controls = "3"
str ax3SHD
ax3SHD="d:\"
;ax3SHD="http://www.microsoft.com"
if(!ShowDialog(dd &sub.DlgProc &controls)) ret


#sub DlgProc
function# hDlg message wParam lParam

sel message
,case WM_INITDIALOG
,int c=child("" "SysListView32" hDlg) ;;the topmost child window of the web browser control
,;int c=child("" "Internet Explorer_Server" hDlg) ;;the topmost child window of the web browser control
,outw c ;;if the control still not created, use a timer to wait until created, then kill timer
,SetWindowSubclass(c &sub.WndProc_Subclass 1 0)
,
,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_LBUTTONDOWN
,out "left down"

,case WM_RBUTTONDOWN
,out "riht down"

int R=DefSubclassProc(hwnd message wParam lParam)

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

ret R
#3
Thank you!!!


Forum Jump:


Users browsing this thread: 1 Guest(s)