Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Catching Key Event of an Edit Box

Catching Key Event of an Edit Box

Scheduled Pinned Locked Moved C / C++ / MFC
question
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    ajitatif angajetor
    wrote on last edited by
    #1

    Hi everyone, I've been digging up for a way to handle key presses (specifically CTRL+A KeyDown) for the EditBox in the ComboBoxEx in my IE toolbar and have failed everytime. I tried to handle the WM_KEYDOWN events but I just couldn't. The ComboBox won't fire any event and I want to select all the text within the EditBox when user presses CTRL+A. There must surely be a way but what could that be?

    L 1 Reply Last reply
    0
    • A ajitatif angajetor

      Hi everyone, I've been digging up for a way to handle key presses (specifically CTRL+A KeyDown) for the EditBox in the ComboBoxEx in my IE toolbar and have failed everytime. I tried to handle the WM_KEYDOWN events but I just couldn't. The ComboBox won't fire any event and I want to select all the text within the EditBox when user presses CTRL+A. There must surely be a way but what could that be?

      L Offline
      L Offline
      led mike
      wrote on last edited by
      #2

      Maybe this article[^] will help

      led mike

      A 1 Reply Last reply
      0
      • L led mike

        Maybe this article[^] will help

        led mike

        A Offline
        A Offline
        ajitatif angajetor
        wrote on last edited by
        #3

        I checked out the article but there's something I just can't catch: The ComboBoxEx does not recieve any WM_KEYDOWN events from the EditBox within. I used Spy++ to see that the event doesn't even get past the ComboBox control inside the ComboBoxEx. So, how can I catch the WM_KEYDOWN event when I can't catch it on the parent?

        M 1 Reply Last reply
        0
        • A ajitatif angajetor

          I checked out the article but there's something I just can't catch: The ComboBoxEx does not recieve any WM_KEYDOWN events from the EditBox within. I used Spy++ to see that the event doesn't even get past the ComboBox control inside the ComboBoxEx. So, how can I catch the WM_KEYDOWN event when I can't catch it on the parent?

          M Offline
          M Offline
          malaugh
          wrote on last edited by
          #4

          Not sure if this helps but you need to use this code to get return keys in your derived class. Maybe the same for your probem? UINT CEdit_xx::OnGetDlgCode() { return( CEdit::OnGetDlgCode() | DLGC_WANTALLKEYS ); }

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups