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

    When someone types one character on an edit control, how can I know wich character has been written

    Hi !,

    When someone types one character on an edit control, how can I know wich character has been written ?

    Thanks, Bye !
    Braulio


  2. #2
    Join Date
    May 1999
    Posts
    3,332

    Re: When someone types one character on an edit control, how can I know wich character has been writ

    by subclassing the edit control and trapping the WM_CHAR message...


  3. #3
    Join Date
    Apr 1999
    Location
    SungNam KyungKi Korea
    Posts
    14

    Re: When someone types one character on an edit control, how can I know wich character has been writ

    Use PreTranslateMessage() !

    Override PreTranslateMessage() in that class using classwizard and type code like this


    ......::PreTranslateMessage(MSG* pMsg)
    {
    CEdit *pEdit = (CEdit *)GetDlgItem(IDC_EDIT1);
    if(pMsg->message == WM_CHAR)
    {
    if(GetFocus()==pEdit) {
    // here code to find character
    }
    }
    }







    by nfuox

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

    THANKS !!!! Works Very good !

    SUPER !! WORKS QUITE GOOD !

    Hi,

    Thanks for your help, it works good !!

    One question more about this "PreTranslateMessage", is possible too, to put out message that I don't want ?, for example I have a problem with DropDown and SetSelEndOk, of the combo boxes, every time DorpDown is called, SetSelEndOk is called after, is possible to take the message that recieves SetSelEndOk, and put it out ? What Happens with the function that has sended the "SendMessage" keeps waiting always or not ?...

    Another question ( a little bit more silly ;-) ), is there something like a "PosTranslateMessage" ( when the message has been received and proccessed capture it and set somethings...).

    Thanks very much for your help Bye !
    Braulio


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