Getting Mouse events inside a modeless dialog

"amante1il" <[email protected]>
Newsgroups gmane.comp.windows.wtl
Message-ID <[email protected]>
Hi,

Sorry guys, i have tried everything and still i could not get the WM_LBUTTONDBLCLK or even WM_LBUTTONDOWN in my Modeless dialog.

I tried wiring the modeless dialog into the main loop by inheriting from CMessageFilter and adding it to the loop. I tried checking in the local modeless PreTranslateMessage for IsDialogMessage and i tried adding it to my MainFrame PreTranslateMessage: IsDialogMessage and i tried to add it to my MainView PreTranslateMessage and i tried it all together and IT DID NOT WORK.

I tried to add a static control and subclass it to send me WM_LBUTTONDOWN and it didn't work.

Ahhhh ...

Eventually i solved it in a very ugly way using WM_NCHITTEST:
int lastX;
int lastY;
unsigned int lastTime;
LRESULT OnNCHitTest(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
	//CString str;
	//str.Format(L"uMsg: %d, wParam: %d, lParam: %d\n", uMsg, wParam, lParam);
	//ATLTRACE(str);
		
	int xPos = GET_X_LPARAM(lParam); 
	int yPos = GET_Y_LPARAM(lParam);
	if(xPos == lastX && yPos == lastY)
	{
		unsigned int now = GetTickCount();
		unsigned int diff = now - lastTime;
		lastTime = GetTickCount();
		if(diff > 90 && diff < 200)
		{
		    ATLTRACE(L"Double Click\n");
		}
         }
}

Can anyone still help with getting a WM_LBUTTONDBLCLK in modeless dialogs? to mention i have a few modeless dialogs open simultaniosly from my MainView and i hold a pointer to them in a map.

Thanks,
Don





------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/wtl/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/wtl/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[email protected] 
    mailto:[email protected]

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.