Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Processing messages from WindowProc
#3
Yes, some of the messages are processed but not the mouse messages for some reason.
Function WinProcMessages
Code:
Copy      Help
function [nCode] [wParam] [CWPSTRUCT*m]

if(getopt(nargs)=0)
,int+ g_whook=SetWindowsHookEx(WH_CALLWNDPROC &WinProcMessages 0 GetCurrentThreadId)
,mes 1
,if(!ShowDialog("diggy" 0)) ret
,ret

sel m.message
,case WM_NCLBUTTONDOWN
,out "WM_NCLBUTTONDOWN"

,case WM_LBUTTONDOWN
,out "WM_LBUTTONDOWN"

,case WM_NCHITTEST
,out "WM_NCHITTEST"
,if(m.lParam=HTBOTTOM)
,,out "HTBOTTOM"
,if(m.lParam=HTZOOM)
,,out "HTZOOM"

ret CallNextHookEx(g_whook nCode wParam m)

I'd like to get the WM_NCHITTEST messages for any active window. The code below seems to work better for this purpose, but is there a more efficient way?
Code:
Copy      Help
rep
,0.1
,POINT p; xm(p)
,int ht=SendMessage(win WM_NCHITTEST 0 (p.x&0xffff)|(p.y<<16))
,sel ht
,,case HTBOTTOM out "HTBOTTOM"
,,case HTCAPTION out "HTCAPTION"


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)