Click here to Skip to main content
15,895,283 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i made an app using the vs2010 wizard and created a navigation pane which generates a dockable window CDockablePane called CFileView

all works well and i can right click on the items in the dummy menu items and get a callback to OnContextMenu

but i want to open the file with a double click so i put ON_WM_LBUTTONDBLCLK() in the message map and 'afx_msg void OnLButtonDblClk( UINT nFlags, CPoint point );' in the declare message map and made a body for OnLButtonDblClk

this normally works just fine, it catches double clicks, but for some reason i cannot work out, it refuses to call the my OnLButtonDblClk when i double click the file name in the window.

this should be fairly basic stuff and i have no idea why its not working. i would really love some help, thanks

BTW i've tried left mouse up and down and they don't work either, its seems to be blocking left mouse click but ON_WM_CONTEXTMENU i.e. right mouse is fine.
Posted

1 solution

update

i added the following to my class
C#
BOOL CFileView::PreTranslateMessage(MSG* pMsg)
{
    switch (pMsg->message)
    {
    case WM_LBUTTONDBLCLK:
        OnFileOpen();
        break;
    }
    return CDockablePane::PreTranslateMessage(pMsg);
}


the PreTranslateMessage is seeing the WM_LBUTTONDBLCLK as you would expect but i still do not know why its not making its way to callback OnLButtonDblClk

calling open from PreTranslateMessage seems to work ok but i know that is not where it is supposed to go
 
Share this answer
 
v3
Comments
redone218 8-Aug-11 12:53pm    
I have same prolem. I have added this code.
if (pMsg->message==WM_LBUTTONDBLCLK)
{
AfxMessageBox(L"Double click");
}
It not work. There is no messagebox.
Anyone can resolve it, please?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900