Re: NM_DBLCLK handler for a CListViewCtrl

Jim Barry <[email protected]> Fri, 11 Feb 2011 11:20:56 +0000
Newsgroups gmane.comp.windows.wtl
Message-ID <[email protected]>
Try LVN_KEYDOWN instead of NM_KEYDOWN. Don't forget to change NMKEY
to NMLVKEYDOWN as well.

On 11 February 2011 09:44, addicted2freefall <addicted2freefall-/[email protected]>wrote:

> I've got a CListViewCtrl in a dialog application.  In my message map, I
> declare a couple of event handlers for the list view ctrl.  NM_DBLCLK works
> as expected, but NM_KEYDOWN appears to do nothing.
>
> Can anyone point out what I'm missing in order to get the list ctrl
> responding to keydown events -
>
> Here's my code:
>
> BEGIN_MSG_MAP(...)
>  NOTIFY_HANDLER_EX( IDC_JOB_DETAIL, NM_DBLCLK, OnDblClickEntry )
>  NOTIFY_HANDLER_EX( IDC_JOB_DETAIL, NM_KEYDOWN, OnKeyDownEntry )
> END_MSG_MAP()
>
> LRESULT OnDblClickEntry (NMHDR* pNMHDR )
> {...}
>
> LRESULT OnKeyDownEntry ( NMHDR* pNMHDR )
> {
>        NMKEY * pKey = reinterpret_cast<NMKEY*> (pNMHDR);
>        BOOL bYawn;
>
>        if( pKey )
>                if( pKey->nVKey == VK_DELETE )
>                        OnDeleteJob(0,0,0,bYawn);
>
>        return 0;
> }


[Non-text portions of this message have been removed]



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

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:
    [email protected] 
    [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/