Click here to Skip to main content
15,923,789 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How to get datas from an edit control (in the toolbar) by pressing return (enter) ? Pin
Mark Salsbery7-Apr-08 9:01
Mark Salsbery7-Apr-08 9:01 
GeneralRe: How to get datas from an edit control (in the toolbar) by pressing return (enter) ? Pin
CrocodileBuck7-Apr-08 9:22
CrocodileBuck7-Apr-08 9:22 
GeneralRe: How to get datas from an edit control (in the toolbar) by pressing return (enter) ? Pin
CrocodileBuck7-Apr-08 9:30
CrocodileBuck7-Apr-08 9:30 
GeneralRe: How to get datas from an edit control (in the toolbar) by pressing return (enter) ? Pin
Mark Salsbery7-Apr-08 9:36
Mark Salsbery7-Apr-08 9:36 
GeneralRe: How to get datas from an edit control (in the toolbar) by pressing return (enter) ? Pin
CrocodileBuck7-Apr-08 9:45
CrocodileBuck7-Apr-08 9:45 
GeneralRe: How to get datas from an edit control (in the toolbar) by pressing return (enter) ? Pin
Mark Salsbery7-Apr-08 10:00
Mark Salsbery7-Apr-08 10:00 
GeneralRe: How to get datas from an edit control (in the toolbar) by pressing return (enter) ? Pin
led mike7-Apr-08 10:04
led mike7-Apr-08 10:04 
GeneralRe: How to get datas from an edit control (in the toolbar) by pressing return (enter) ? Pin
Mark Salsbery7-Apr-08 10:11
Mark Salsbery7-Apr-08 10:11 
Ok, I steered you wrong with the enter key, sorry.  Change your CMyEdit class like this and it works fine in your code:
// MyEdit.h

#pragma once

class CMyEdit : public CEdit
{
    DECLARE_DYNAMIC(CMyEdit)
        
public:
    CMyEdit();
    virtual ~CMyEdit();

    virtual BOOL PreTranslateMessage(MSG* pMsg);
    
protected:
    DECLARE_MESSAGE_MAP()
};

///////////////////////////////////////////////////////////////////////////

// MyEdit.cpp


#include "stdafx.h"
#include "MyEdit.h"

IMPLEMENT_DYNAMIC(CMyEdit, CEdit)

CMyEdit::CMyEdit() : CEdit()
{
}

CMyEdit::~CMyEdit()
{
}

BEGIN_MESSAGE_MAP(CMyEdit, CEdit)
END_MESSAGE_MAP()

BOOL CMyEdit::PreTranslateMessage(MSG* pMsg)
{
    if (pMsg->message == WM_KEYDOWN && VK_RETURN == pMsg->wParam) 
    {
        return TRUE;
    }
    else if (pMsg->message == WM_KEYUP && VK_RETURN == pMsg->wParam) 
    {
        // Do stuff!

        MessageBox("Works","Works" ,MB_OK);

        return TRUE;
    }

    return CEdit::PreTranslateMessage(pMsg);
}

Mark




Mark Salsbery
Microsoft MVP - Visual C++

Java | [Coffee]

GeneralRe: How to get datas from an edit control (in the toolbar) by pressing return (enter) ? Pin
CrocodileBuck7-Apr-08 10:59
CrocodileBuck7-Apr-08 10:59 
Generala problem when wait for a thread to be completed Pin
followait7-Apr-08 5:30
followait7-Apr-08 5:30 
QuestionRe: a problem when wait for a thread to be completed Pin
David Crow7-Apr-08 6:05
David Crow7-Apr-08 6:05 
GeneralRe: a problem when wait for a thread to be completed Pin
followait7-Apr-08 7:37
followait7-Apr-08 7:37 
GeneralRe: a problem when wait for a thread to be completed Pin
David Crow7-Apr-08 8:10
David Crow7-Apr-08 8:10 
GeneralRe: a problem when wait for a thread to be completed Pin
Jim Crafton7-Apr-08 9:24
Jim Crafton7-Apr-08 9:24 
GeneralRe: a problem when wait for a thread to be completed Pin
Stephen Hewitt7-Apr-08 15:19
Stephen Hewitt7-Apr-08 15:19 
GeneralRe: a problem when wait for a thread to be completed Pin
ThatsAlok7-Apr-08 19:28
ThatsAlok7-Apr-08 19:28 
GeneralRe: a problem when wait for a thread to be completed Pin
Mark Salsbery7-Apr-08 6:16
Mark Salsbery7-Apr-08 6:16 
GeneralRe: a problem when wait for a thread to be completed Pin
led mike7-Apr-08 7:10
led mike7-Apr-08 7:10 
GeneralRe: a problem when wait for a thread to be completed Pin
Jim Crafton7-Apr-08 9:16
Jim Crafton7-Apr-08 9:16 
GeneralRe: a problem when wait for a thread to be completed Pin
led mike7-Apr-08 10:01
led mike7-Apr-08 10:01 
GeneralRe: a problem when wait for a thread to be completed Pin
ThatsAlok7-Apr-08 19:29
ThatsAlok7-Apr-08 19:29 
GeneralRe: a problem when wait for a thread to be completed Pin
followait7-Apr-08 7:39
followait7-Apr-08 7:39 
GeneralRe: a problem when wait for a thread to be completed Pin
Mark Salsbery7-Apr-08 7:52
Mark Salsbery7-Apr-08 7:52 
GeneralRe: a problem when wait for a thread to be completed Pin
Cedric Moonen7-Apr-08 7:52
Cedric Moonen7-Apr-08 7:52 
GeneralRe: a problem when wait for a thread to be completed Pin
Randor 7-Apr-08 9:52
professional Randor 7-Apr-08 9:52 

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.