CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    May 1999
    Location
    Spain
    Posts
    335

    How can I get when the user press Enter Key in PreTranslateMessage ?

    Hi,

    I have a property sheet, and I want that when the user press enters it don't close, I have thought in get when the user press the enter key in the pretranslate message of the sheet and throw it away, but I do't know how to trap the enter key...

    Anybody can help me ? Thanks, Bye !
    Braulio


  2. #2
    Join Date
    May 1999
    Posts
    12

    Re: How can I get when the user press Enter Key in PreTranslateMessage ?

    You are right about overriding the PreTranslateMessage. What you have to do here is this. One of the parameters is the MSG structure. In the overridden function put a condition like this
    if(pMsg->wParam == 13)
    {
    //do something here
    return 1;
    }
    else
    //return the default
    I hope this solves ur problem




  3. #3
    Join Date
    May 1999
    Location
    Spain
    Posts
    335

    Thanks !

    Thanks !

    What I do know is check if it's WM_CHAR and wParam==13 ( Intro), and works good, Thanks:
    Braulio

    P.S.: What it's the difference between return 1 or 0 ?.


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