[RESOLVED] WM_KEYDOWN VK_RETURN problem
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Thread: [RESOLVED] WM_KEYDOWN VK_RETURN problem

  1. #1
    Join Date
    Aug 2006
    Location
    Timisoara, Romania
    Posts
    433

    [RESOLVED] WM_KEYDOWN VK_RETURN problem

    Hi!

    I have a WinAPI application that creates a dialogbox from a template. this dialogbox contains a custom control, that I implement myself. This custom control contains two editboxes (created dynamically). The editboxes are single-line.
    The problem I have is that I need to receive VK_RETURN in the message WM_KEYDOWN (not after the button has been released) in the window procedure of the editbox (I have subclassed the editboxes to handle events) and I can't.
    Using Spy++, I have seen that the editbox DOES post the message, but I do not receive it in my "case WM_KEYDOWN:" section of EditProcedure. However, i receive WM_KEYUP when I press VK_RETURN and WM_KEYDOWN when I press VK_BACK.

    can anybody give me an idea about what to do?
    I am using VC++ 2008.

  2. #2
    Join Date
    Nov 2003
    Location
    Belgium
    Posts
    8,062

    Re: WM_KEYDOWN VK_RETURN problem

    Do your editboxes have the style ES_WANTRETURN?

  3. #3
    Join Date
    Aug 2006
    Location
    Timisoara, Romania
    Posts
    433

    Re: WM_KEYDOWN VK_RETURN problem

    Yeah, unfortunately, it happens as the documentation says:
    "This style has no effect on a single-line edit control." - it works only with a multiline editbox.

  4. #4
    Join Date
    Nov 2000
    Location
    Voronezh, Russia
    Posts
    6,022

    Re: WM_KEYDOWN VK_RETURN problem

    Afraid you need WH_MSGFILTER local hook.
    Best regards,
    Igor

  5. #5
    Join Date
    Aug 2006
    Location
    Timisoara, Romania
    Posts
    433

    Re: WM_KEYDOWN VK_RETURN problem

    Thanks a lot!

Posting Permissions

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


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center