Re: help with WM_LBUTTONDOWN
Quote:
Originally Posted by llp00na
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.
Do you have any explanation for that ?
Sure I have. The coordinates arrived are client area related. If you wanna get them in some other system, you have to remap them from original recipient window to desired window (MapWindowPoints). The marginal case is client-to-screen remapping (ClientToScreen).
Re: help with WM_LBUTTONDOWN
Quote:
Originally Posted by Igor Vartanov
Sure I have. The coordinates arrived are client area related. If you wanna get them in some other system, you have to remap them from original recipient window to desired window (
MapWindowPoints). The marginal case is client-to-screen remapping (
ClientToScreen).
Thanx for your reply,
is it possible to detect those clicks on the client area (excluding the control) and ignore them. Because i am only interested in those clicks that happen within the activex control.
Re: help with WM_LBUTTONDOWN
Quote:
Originally Posted by Igor Vartanov
Sure I have. The coordinates arrived are client area related. If you wanna get them in some other system, you have to remap them from original recipient window to desired window (
MapWindowPoints). The marginal case is client-to-screen remapping (
ClientToScreen).
oh i forgot to ask you. You said, *The coordinates arrived are client area related*. In that case why do i get different results for the coordinates. It does not look like the coordinates are being mapped to the same reference point (being the right top corner of the screen). Instead they are mapped to TWO different references (sometimes the top right corner of the client area and the other time to the top right corner of the control) !!!
i dont mind which reference they use as long as they use only one but not both.
Re: help with WM_LBUTTONDOWN
Quote:
Originally Posted by llp00na
Thanx for your reply,
is it possible to detect those clicks on the client area (excluding the control) and ignore them. Because i am only interested in those clicks that happen within the activex control.
Well, never could be a problem. :)
BTW, when I wanna watch live XY changes I use caption text for this. :wave:
Code:
BOOL CPilotStudyDlg::PreTranslateMessage(MSG* pMsg)
{
if( WM_LBUTTONDOWN == pMsg->message)
{
TCHAR name[128] = {0};
GetClassName(pMsg->hwnd, name, 128);
if(0 == lstrcmp(name, "Internet Explorer_Server"))
{
CString s;
s.Format("Mouse: x = %i, y = %i\n", LOWORD(pMsg->lParam), HIWORD(pMsg->lParam));
SetWindowText(s);
fprintf(trial, (LPCTSTR)s);
fflush(trial);
}
else
{
SetWindowText(_T("Not IE window"));
}
}
return CDialog::PreTranslateMessage(pMsg);
}
Re: help with WM_LBUTTONDOWN
Quote:
Originally Posted by Igor Vartanov
Well, never could be a problem. :)
BTW, when I wanna watch live XY changes I use caption text for this. :wave:
Code:
BOOL CPilotStudyDlg::PreTranslateMessage(MSG* pMsg)
{
if( WM_LBUTTONDOWN == pMsg->message)
{
TCHAR name[128] = {0};
GetClassName(pMsg->hwnd, name, 128);
if(0 == lstrcmp(name, "Internet Explorer_Server"))
{
CString s;
s.Format("Mouse: x = %i, y = %i\n", LOWORD(pMsg->lParam), HIWORD(pMsg->lParam));
SetWindowText(s);
fprintf(trial, (LPCTSTR)s);
fflush(trial);
}
else
{
SetWindowText(_T("Not IE window"));
}
}
return CDialog::PreTranslateMessage(pMsg);
}
Oh man,
Thanx very much, that saved me alot of troubles. I really appreciate your help.
I was trying to do the mouse hooking stuff because i thought your way wont get me any results. But you proved me wrong, yet an innovative idea that i failed to think of. I am impressed my friend :-)
Thanx alot once again
Re: help with WM_LBUTTONDOWN
You're welcome. :)
BTW, even if you succeeded with hooking, anyway you were facing with the necessity of distinguishing child windows.