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. Keyboard focus to ActiveX control

Keyboard focus to ActiveX control

Scheduled Pinned Locked Moved C / C++ / MFC
6 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
    Andrew Hoole
    wrote on last edited by
    #1

    Hi I am trying to develop an activex control. The control has methods to respond to the WM_KEYDOWN messages and in the test container these seem to be working but when a put the control on a dialog window the control doesn't seem to get the focus - seems to remain with the dialog window as the OK and cancel buttons flash wildly when I press the up and down keys. How can I get the messages through to the control. Thanks Andrew Hoole

    S V A 3 Replies Last reply
    0
    • A Andrew Hoole

      Hi I am trying to develop an activex control. The control has methods to respond to the WM_KEYDOWN messages and in the test container these seem to be working but when a put the control on a dialog window the control doesn't seem to get the focus - seems to remain with the dialog window as the OK and cancel buttons flash wildly when I press the up and down keys. How can I get the messages through to the control. Thanks Andrew Hoole

      S Offline
      S Offline
      Stephen Hewitt
      wrote on last edited by
      #2

      What framework (if any) are you using? ATL, MFC? Steve

      A 1 Reply Last reply
      0
      • A Andrew Hoole

        Hi I am trying to develop an activex control. The control has methods to respond to the WM_KEYDOWN messages and in the test container these seem to be working but when a put the control on a dialog window the control doesn't seem to get the focus - seems to remain with the dialog window as the OK and cancel buttons flash wildly when I press the up and down keys. How can I get the messages through to the control. Thanks Andrew Hoole

        V Offline
        V Offline
        Viorel
        wrote on last edited by
        #3

        Does the control receive the focus and then WM_KEYDOWN messages if you first click it with the mouse?

        A 1 Reply Last reply
        0
        • A Andrew Hoole

          Hi I am trying to develop an activex control. The control has methods to respond to the WM_KEYDOWN messages and in the test container these seem to be working but when a put the control on a dialog window the control doesn't seem to get the focus - seems to remain with the dialog window as the OK and cancel buttons flash wildly when I press the up and down keys. How can I get the messages through to the control. Thanks Andrew Hoole

          A Offline
          A Offline
          Andrew Hoole
          wrote on last edited by
          #4

          Hi I have solved my problem by making my control handle the WM_GETDLGCODE and forcing it to return DLGC_WANTARROWS|DLGC_WANTALLKEYS|DLGC_WANTCHARS; Still to discover if this has further consequences. Andrew Hoole

          1 Reply Last reply
          0
          • S Stephen Hewitt

            What framework (if any) are you using? ATL, MFC? Steve

            A Offline
            A Offline
            Andrew Hoole
            wrote on last edited by
            #5

            Sorry. I am using Visual C++ 6 and MFC. Andrew

            1 Reply Last reply
            0
            • V Viorel

              Does the control receive the focus and then WM_KEYDOWN messages if you first click it with the mouse?

              A Offline
              A Offline
              Andrew Hoole
              wrote on last edited by
              #6

              No the control is handle mouse message just fine but even after clicking in the window several times the key messages don't get through. See my further post regarding how I might have fixed it. My concern now is if I have several of these controls on a dialog which one will respond to the messages. Andrew

              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