Click to See Complete Forum and Search --> : Lbn_dblclk


Notsosuperhero
December 22nd, 2004, 01:02 PM
When I try to handle the LBN_DBLCLK message it states that case 2 is already used with WM_DESTROY. LBN_DBLCLK is defined as 2 and WM_DESTROY is defined as 0x0002. How can I get this to work?

NoHero
December 22nd, 2004, 01:27 PM
When I try to handle the LBN_DBLCLK message it states that case 2 is already used with WM_DESTROY. LBN_DBLCLK is defined as 2 and WM_DESTROY is defined as 0x0002. How can I get this to work?

If you do it correctly, there is no way to mix it up with WM_DESTROY: You will recieve LBN_DBLCLK within the WM_COMMAND message. The highest word of wParam will be LBN_DBLCLK if the user clicks on your items twice.


case WM_COMMAND:
{
switch ( LOWORD(wParam) )
{ // Select the ID
case IDC_LISTBOX:
{
if ( HIWORD(wParam) == LBN_DBLCLK )
{ // Handle double click right here.
}
}
break;

default: // Default handling
}
}
break;


MSDN article about LBN_DBLCLK. (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/commctls/listboxes/listboxreference/listboxmessages/lbn_dblclk.asp)