Thread: getting HWND of controls

  1. #1
    Registered User
    Join Date
    Aug 2004

    getting HWND of controls

    I can get the HWND of a different window, but now I need to get the HWND of a control. The control would be like a textbox or button.

    It is for a little project I am working.

    I tried getting the HWND of a child window but that didn't return the HWND of the textbox, I don't belive.

  2. #2
    Registered User Tonto's Avatar
    Join Date
    Jun 2005
    New York
    Perhaps, in a function like your WindowProc, you could throw a:

    HWND child = ::GetDlgItem(hwnd, ID_SOMECONTROL);
    Where ID_SOMECONTROL is the identifier in the resource or passed as the HMENU parameter of ::CreateWindow[Ex](..)

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Avoiding Global variables
    By csonx_p in forum Windows Programming
    Replies: 32
    Last Post: 05-19-2008, 12:17 AM
  2. Button handler
    By Nephiroth in forum Windows Programming
    Replies: 8
    Last Post: 03-12-2006, 06:23 AM
  3. My first "real" windows app
    By JoshR in forum Windows Programming
    Replies: 2
    Last Post: 07-28-2005, 07:40 AM
  4. opengl program as win API menu item
    By SAMSAM in forum Game Programming
    Replies: 1
    Last Post: 03-03-2003, 07:48 PM