hi there, im using mfc
when i close my dialog box i want to disable mouse move events, so any idea how to do that?

i want to do that because i have problems, mouse move event happen before closing dialog box and i dont want that. have no idea why is this happening.

here is some code:
i call dialog box:

nRet = shpman.DoModal();  
    if ( nRet == IDOK || nRet == IDCANCEL  )
    {
      dialog_close = 5; 
    }

and here is mouse movement event:

void COpenGLWnd::OnMouseMove(UINT nFlags, CPoint point)
{
 
      if(!mLeftButtonDown && dialog_close !=5)
          OnMouseMoveTips(nFlags, point);
}

there is problem - I dont wanna call function OnMouseMoveTips(nFlags, point); when i close my Dialog box.
but for some reason the function is called when i close dialog if my mouse is on wnd,
if i close dialog outside my wnd everything is ok..

can u help me plesase??im gettin crazy:( tnx for any help

You are setting dialog_close flag too late. Set that to 5 in the OnClose() event handler.

how can i do that? cant find onclose() event handler... :(

i have only these events in my msg map

BEGIN_MESSAGE_MAP(CDialogNew, CDialog)
ON_BN_CLICKED(IDC_BUTTONLoad, &CDialogNew::OnBnClickedButtonload)
ON_BN_CLICKED(IDOK2, &CDialogNew::OnBnClickedOK)
ON_BN_CLICKED(IDC_BUTTONSave, &CDialogNew::OnBnClickedButtonsave)
END_MESSAGE_MAP()

You have to add it, probably to CMainFrm class. Add it just as you would any other event handler. Read this thread.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.