CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Guest

    getting a HWND for a window

    what is the best way to get a HWND for a window when inside another window.
    i have to get a HWND instead of a CWnd, because im using a callback function
    (TimerProc) which reguires a HWND.
    or
    a way to get a CWnd and them get a HWND from that

    thanks
    Paul


  2. #2
    Join Date
    Apr 1999
    Posts
    306

    Re: getting a HWND for a window

    Use GetSafeHwnd();


  3. #3
    Join Date
    Apr 1999
    Location
    Malaysia
    Posts
    224

    Re: getting a HWND for a window

    If you mean you want to get the HWND of a chirldren window for the parent window.
    you can use FindWindowEx.
    Hope i didn't get you wrong..

    Hello World!!!

  4. #4
    Guest

    Re: getting a HWND for a window

    i want to get the HWND of a parent from a child


  5. #5
    Join Date
    Apr 1999
    Location
    Malaysia
    Posts
    224

    Re: getting a HWND for a window

    From Visual C++ help

    "The GetParent function retrieves the handle of the specified child window’s parent window."
    HWND GetParent(
    HWND hWnd // handle of child window
    );
    This is want you want????

    Hello World!!!

  6. #6
    July Guest

    Re: getting a HWND for a window

    You can first use GetParent()Member function inorder to get a CWnd object of
    the parent.Then using that ...you can find HWND by using GetSafeHwnd()


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured