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. Need Your Help!!!!

Need Your Help!!!!

Scheduled Pinned Locked Moved C / C++ / MFC
help
5 Posts 4 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.
  • J Offline
    J Offline
    Jack Fu
    wrote on last edited by
    #1

    Who can tell me how I can get the HWND of Edit Box in a window,if I have get the CWnd of the window.thank you very much!!! Jack

    M R T 3 Replies Last reply
    0
    • J Jack Fu

      Who can tell me how I can get the HWND of Edit Box in a window,if I have get the CWnd of the window.thank you very much!!! Jack

      M Offline
      M Offline
      mkuhac
      wrote on last edited by
      #2

      // Wnd is an instance of CWnd HWND hwndEdit = ::GetDlgItem (Wnd.GetSafeHwnd(), ID_EDIT);

      J 1 Reply Last reply
      0
      • M mkuhac

        // Wnd is an instance of CWnd HWND hwndEdit = ::GetDlgItem (Wnd.GetSafeHwnd(), ID_EDIT);

        J Offline
        J Offline
        Jack Fu
        wrote on last edited by
        #3

        Thank you~~But idon't know The ID_EDIT.Indeed I need a function that auto detect the current window which contain a text box,and then record the window title. Jack

        1 Reply Last reply
        0
        • J Jack Fu

          Who can tell me how I can get the HWND of Edit Box in a window,if I have get the CWnd of the window.thank you very much!!! Jack

          R Offline
          R Offline
          Rage
          wrote on last edited by
          #4

          If you have a CWnd from your edit box, let's name it MyWnd, then simply use HWND MyHandle = MyWnd.m_hwnd. CWnd::m_hWnd is public. ~RaGE();

          1 Reply Last reply
          0
          • J Jack Fu

            Who can tell me how I can get the HWND of Edit Box in a window,if I have get the CWnd of the window.thank you very much!!! Jack

            T Offline
            T Offline
            ThatsAlok
            wrote on last edited by
            #5

            CWnd::GetSafeHwnd()

            "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

            cheers, Alok Gupta

            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