I am trying to capture the x,y of mouse click events. I therefore have added a notification message "WM_LBUTTONDOWN" to my application (Being a IE -- which uses the microsoft activex control).
Now i am printing some stuff within the event handler of WM_LBUTTONDOWN. however, nothing happens.
I have noticed that it does not work if you are capturing event on the control. However, I can capture the event when I try to detect mouse click on the dialog. What actually you wish to do?
I have noticed that it does not work if you are capturing event on the control. However, I can capture the event when I try to detect mouse click on the dialog. What actually you wish to do?
Actually, the user will be using the IE. I have to save the position of his clicks. so he will be clicking on the microsoft activex control
Now i am printing some stuff within the event handler of WM_LBUTTONDOWN. however, nothing happens.
What exactly do you mean by "printing some stuff"? And: Where are you handling the WM_LBUTTONDOWN message? In a class derived from the browser control, or in the containing window? From what you posted, you are handling it in the (CWinApp-derived) application class - this won't work, since it's not a window.[/QUOTE]
What exactly do you mean by "printing some stuff"? And: Where are you handling the WM_LBUTTONDOWN message? In a class derived from the browser control, or in the containing window? From what you posted, you are handling it in the (CWinApp-derived) application class - this won't work, since it's not a window.
[/QUOTE]
I have added the WM_LBUTTONDOWN message to the main dialog window.
Please have a look at the attachment.
i have no previous knowledge about hooking. I have been looking at some articles and it looked too complicated for me (i am very notice to visual c++).
If WM_LBUTTONDOWN is a possible solution, i would prefer to do it this way. else or i will find myself obliged to do it the hard way (mouse hook).
See Hooking is not That Much a hard task
you have to perform following step .details you can found in MSDN if still Problem Let us Know
1)use SetWindowsHookEx() for installing the hook in your Application
2)define your Callback procedure now
3)use UnhookWindowsHookEx() function to unhook your Window
a idea
Code:
::SetWindowsHookEx(WH_MOUSE,GetMessageProc,....,.......); //Sets the hook on your mouse
::UnhookWindowsHookEx(HHOOK hhk)//after finishing your work unhook it
Code:
//Now write your Procedure
GetMessageProc(int nCode, WPARAM wParam, LPARAM lParam)
{
//write your code here
// Passes the hook information to the next hook procedure in
// the current hook chain.
return ::CallNextHookEx(m_hHook, nCode, wParam, lParam);
}
thankyou
Last edited by humptydumpty; May 10th, 2006 at 07:57 AM.
See Hooking is not That Much a hard task
you have to perform following step .details you can found in MSDN if still Problem Let us Know
1)use SetWindowsHookEx() for installing the hook in your Application
2)define your Callback procedure now
3)use UnhookWindowsHookEx() function to unhook your Window
a idea
Code:
::SetWindowsHookEx(WH_MOUSE,GetMessageProc,....,.......); //Sets the hook on your mouse
::UnhookWindowsHookEx(HHOOK hhk)//after finishing your work unhook it
Code:
//Now write your Procedure
GetMessageProc(int nCode, WPARAM wParam, LPARAM lParam)
{
//write your code here
// Passes the hook information to the next hook procedure in
// the current hook chain.
return ::CallNextHookEx(m_hHook, nCode, wParam, lParam);
}
thankyou
is there any need to use a dll. and when do i exactly need to use global hook functions.
In my application i will need to record user left clicks on the microsoft activex control. would your approach described above be sufficient
dll for wat ?
and all above is only a idea to show you that you don't have to take a lot of burden in case of hooking. in case of GetMessageProc() simply do what ever you want.
Just Read Once Again in MSDN.
Okay .
if Still Problem Let us know.So i will Send you a sample workspace .
dll for wat ?
and all above is only a idea to show you that you don't have to take a lot of burden in case of hooking. in case of GetMessageProc() simply do what ever you want.
Just Read Once Again in MSDN.
Okay .
if Still Problem Let us know.So i will Send you a sample workspace .
Thankyou
the reason why i mentioned a dll,
MSDN**
You must place a global hook procedure in a dynamic-link library (DLL) separate from the application installing the hook procedure**
I have got one slight problem. I have noticed that when i click next to the address bar (on Url Address text ) i receive a value for *y* that is bigger than the value of *y* received when clicking on the microsoft control (just below the area where the control and the dialog meets). In fact, y values should increase as i go away from top to bottom.
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.