CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 9 of 9
  1. #1
    Join Date
    Jul 1999
    Posts
    30

    Enter-button override

    I overrided my SDI-FormView-View with PreTransLateMessage(MSG* pMsg), so I was able to override my left and right arrows. Now I want to override my Return&Enter buttons, but I do not know the Virtual Key Code. Can U help me out?

    Student Flanders Language Valley
    Programmer

  2. #2
    Join Date
    Jun 1999
    Location
    Croatia
    Posts
    14

    Re: Enter-button override

    The code for enter is VK_ENTER.
    Sasa


  3. #3
    Join Date
    Jul 1999
    Posts
    30

    Re: Enter-button override

    Sasa, It's not working! The following function gives an error on VK_ENTER(undeclared identifier):

    BOOL CMenuutjeView::PreTranslateMessage(MSG* pMsg)
    {
    CMenuutjeDoc* pDoc=GetDocument();
    // TODO: Add your specialized code here and/or call the base class
    if(pMsg->message == WM_KEYDOWN)
    {
    bool bProcessed = false;
    if (pMsg->wParam == VK_LEFT)
    {
    bProcessed = true;
    pDoc->Verschuif(false);
    Invalidate();
    }
    if (pMsg->wParam == VK_RIGHT)
    {
    bProcessed = true;
    pDoc->Verschuif(true);
    Invalidate();
    }
    if (pMsg->wParam == VK_ENTER)
    {
    bProcessed = true;
    MessageBox("ENTER");
    OnEnter();
    }
    if (bProcessed)
    return true;
    }
    return CFormView::PreTranslateMessage(pMsg);
    }



    What could possibly be the problem?

    Student Flanders Language Valley
    Programmer

  4. #4
    Join Date
    May 1999
    Location
    Antwerp, Belgium
    Posts
    136

    Re: Enter-button override

    Use VK_RETURN.


  5. #5
    Join Date
    Jun 1999
    Location
    Croatia
    Posts
    14

    Re: Enter-button override

    I just suggested to use VK_ENTER, but I didn't said how to do it.
    Greetings, Sasa


  6. #6
    Join Date
    Jun 1999
    Location
    Croatia
    Posts
    14

    Re: Enter-button override

    Virtual key VK_RETURN does not exist.
    Sasa


  7. #7
    Join Date
    May 1999
    Location
    Antwerp, Belgium
    Posts
    136

    Re: Enter-button override

    I use VK_RETURN in my PreTranslateMessage. So it does exist !


  8. #8
    Join Date
    Jul 1999
    Posts
    30

    Re: Enter-button override

    Thanx, Franky, VK_RETURN works just fine!
    Thanx to you too, Sasa!

    Student Flanders Language Valley
    Programmer

  9. #9
    Join Date
    Jun 1999
    Location
    Croatia
    Posts
    14

    Re: Enter-button override

    Sorry, i've searched for it MSDN Library and VK_RETURN isn't there.
    Sasa


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured