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. How can a window in a dialog receive keyboard message?

How can a window in a dialog receive keyboard message?

Scheduled Pinned Locked Moved C / C++ / MFC
graphicsquestion
3 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.
  • S Offline
    S Offline
    sude
    wrote on last edited by
    #1

    How can a window in a dialog receive keyboard message? I create a window in a dialog.This window can show 3D drawing including rotation and can receive mouse message,but it can not receive keyboard message. Please tell me why,Thank you for your answer.My code for create window is as follow.Maybe it need more parameter. My program for create window is as follow: R1=CRect(200, 7, 1000, 200); // TODO: Add extra initialization here m_pDisplay->Create( NULL, //CWnd default NULL, //has no name WS_CHILD|WS_CLIPSIBLINGS|WS_CLIPCHILDREN|WS_VISIBLE, R1, this, //this is the parent u1); sude

    I J 2 Replies Last reply
    0
    • S sude

      How can a window in a dialog receive keyboard message? I create a window in a dialog.This window can show 3D drawing including rotation and can receive mouse message,but it can not receive keyboard message. Please tell me why,Thank you for your answer.My code for create window is as follow.Maybe it need more parameter. My program for create window is as follow: R1=CRect(200, 7, 1000, 200); // TODO: Add extra initialization here m_pDisplay->Create( NULL, //CWnd default NULL, //has no name WS_CHILD|WS_CLIPSIBLINGS|WS_CLIPCHILDREN|WS_VISIBLE, R1, this, //this is the parent u1); sude

      I Offline
      I Offline
      includeh10
      wrote on last edited by
      #2

      it can receive keyboard input if it gets focus (by SetFocus() function). the window may need TABSTOP style or something else. includeh10

      1 Reply Last reply
      0
      • S sude

        How can a window in a dialog receive keyboard message? I create a window in a dialog.This window can show 3D drawing including rotation and can receive mouse message,but it can not receive keyboard message. Please tell me why,Thank you for your answer.My code for create window is as follow.Maybe it need more parameter. My program for create window is as follow: R1=CRect(200, 7, 1000, 200); // TODO: Add extra initialization here m_pDisplay->Create( NULL, //CWnd default NULL, //has no name WS_CHILD|WS_CLIPSIBLINGS|WS_CLIPCHILDREN|WS_VISIBLE, R1, this, //this is the parent u1); sude

        J Offline
        J Offline
        Joel Lucsy
        wrote on last edited by
        #3

        The control probably doesn't handle WM_GETDLGCODE, which is used to determine what kind of keyboard messages it should receive. If you've derived from CWnd, then override the OnGetDlgCode function. -- Joel Lucsy

        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