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. Child window can't get focus

Child window can't get focus

Scheduled Pinned Locked Moved C / C++ / MFC
3 Posts 2 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.
  • T Offline
    T Offline
    TianYang
    wrote on last edited by
    #1

    The m_child is derive from CWnd, but it can't get focus, the caption of this child window is always gray. m_child.Create( NULL, "OK", WS_VISIBLE | WS_CHILD | WS_CAPTION, rc, this, 100, NULL );

    I 1 Reply Last reply
    0
    • T TianYang

      The m_child is derive from CWnd, but it can't get focus, the caption of this child window is always gray. m_child.Create( NULL, "OK", WS_VISIBLE | WS_CHILD | WS_CAPTION, rc, this, 100, NULL );

      I Offline
      I Offline
      Iain Clarke Warrior Programmer
      wrote on last edited by
      #2

      You need to provide more information. What class is m_Child? Where are you creating it? If this is on a dialog, you may be missing WS_TABSTOP. If you are inheriting from CStatic then you will also have issues, as that passed focus to its parent. You should also look up WM_GETDLGCODE. etc. Iain.

      T 1 Reply Last reply
      0
      • I Iain Clarke Warrior Programmer

        You need to provide more information. What class is m_Child? Where are you creating it? If this is on a dialog, you may be missing WS_TABSTOP. If you are inheriting from CStatic then you will also have issues, as that passed focus to its parent. You should also look up WM_GETDLGCODE. etc. Iain.

        T Offline
        T Offline
        TianYang
        wrote on last edited by
        #3

        m_Child is my custom window and it derive from CWnd, this is SDI project, m_Chils is member of my view.

        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