Click here to Skip to main content
15,911,139 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: [win32]ListView doesn't generate VK_RETURN Pin
Ryan Binns29-Jun-03 21:19
Ryan Binns29-Jun-03 21:19 
GeneralRe: [win32]ListView doesn't generate VK_RETURN Pin
User 665829-Jun-03 22:59
User 665829-Jun-03 22:59 
GeneralRe: [win32]ListView doesn't generate VK_RETURN Pin
Ryan Binns29-Jun-03 23:31
Ryan Binns29-Jun-03 23:31 
GeneralRe: [win32]ListView doesn't generate VK_RETURN Pin
Melekor30-Jun-03 7:08
Melekor30-Jun-03 7:08 
GeneralRe: [win32]ListView doesn't generate VK_RETURN Pin
Ryan Binns30-Jun-03 14:44
Ryan Binns30-Jun-03 14:44 
GeneralRe: [win32]ListView doesn't generate VK_RETURN Pin
JT Anderson1-Jul-03 12:20
JT Anderson1-Jul-03 12:20 
GeneralRe: [win32]ListView doesn't generate VK_RETURN Pin
Melekor1-Jul-03 13:06
Melekor1-Jul-03 13:06 
GeneralRe: [win32]ListView doesn't generate VK_RETURN Pin
JT Anderson1-Jul-03 13:41
JT Anderson1-Jul-03 13:41 
Aha! I was going to set out to prove you wrong about that, but now think I know what your problem is.

Your CListCtrl is in a dialog, right? As some of the other responses may have suggested, the dialog is eating your VK_RETURN messages. I suggest that you derive a class from CListCtrl and add a WM_GETDLGCODE handler something like this:

UINT CListCtrlEx::OnGetDlgCode() 
{
    const MSG *pMsg = (const MSG *)GetCurrentMessage()->lParam;

    if (pMsg != NULL &&
        pMsg->message == WM_KEYDOWN &&
        pMsg->wParam == VK_RETURN) {
	     return DLGC_WANTMESSAGE;
    }
	
    return CListCtrl::OnGetDlgCode();
}


Assuming that you want the same thing to happen for double-clicks and the enter key, you should handle LVN_ITEMACTIVATE. If you want to do something different, then this change should get the WM_KEYDOWN/VK_RETURN to your list control.

--------
There are 10 types of people in this world. Those who know binary and those who don't.
GeneralRe: [win32]ListView doesn't generate VK_RETURN Pin
Melekor2-Jul-03 8:06
Melekor2-Jul-03 8:06 
GeneralRe: [win32]ListView doesn't generate VK_RETURN Pin
JT Anderson2-Jul-03 8:19
JT Anderson2-Jul-03 8:19 
Generalusing StgOopenStorageEx.. to know type of the file Pin
pnpfriend29-Jun-03 11:08
pnpfriend29-Jun-03 11:08 
GeneralRe: using StgOopenStorageEx.. to know type of the file Pin
pnpfriend1-Jul-03 5:23
pnpfriend1-Jul-03 5:23 
GeneralDelete user EventLog file Pin
cmk29-Jun-03 10:50
cmk29-Jun-03 10:50 
GeneralCString problem Pin
Sunnygirl29-Jun-03 8:36
Sunnygirl29-Jun-03 8:36 
GeneralRe: CString problem Pin
Ravi Bhavnani29-Jun-03 8:40
professionalRavi Bhavnani29-Jun-03 8:40 
GeneralRe: CString problem Pin
Sunnygirl29-Jun-03 9:00
Sunnygirl29-Jun-03 9:00 
GeneralRe: CString problem Pin
Chris Losinger29-Jun-03 8:40
professionalChris Losinger29-Jun-03 8:40 
GeneralRe: CString problem Pin
Sunnygirl29-Jun-03 9:01
Sunnygirl29-Jun-03 9:01 
GeneralRe: CString problem Pin
FlyingDancer29-Jun-03 18:53
FlyingDancer29-Jun-03 18:53 
GeneralRe: CString problem Pin
FlyingDancer29-Jun-03 19:06
FlyingDancer29-Jun-03 19:06 
GeneralRe: CString problem Pin
Michael Dunn29-Jun-03 19:41
sitebuilderMichael Dunn29-Jun-03 19:41 
GeneralRe: CString problem Pin
FlyingDancer30-Jun-03 3:43
FlyingDancer30-Jun-03 3:43 
GeneralA general solution Pin
Trollslayer30-Jun-03 1:45
mentorTrollslayer30-Jun-03 1:45 
GeneralProblem using Flat Scroll Bars Pin
miguel.lopes@lsi.pt29-Jun-03 7:03
sussmiguel.lopes@lsi.pt29-Jun-03 7:03 
GeneralRepeating socket connection Pin
Anonymous29-Jun-03 3:20
Anonymous29-Jun-03 3:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.