Click to See Complete Forum and Search --> : How to get a handle to a window


May 6th, 1999, 10:28 AM
I need the code that will get a handle to a window or dialog box. Please send me a code snippet and don't just refer me to the help for some function because my help is not working correctly right now.

Thanks
Devin

May 6th, 1999, 12:24 PM
GetSafeHwnd or m_hWnd

Michael Decker
May 6th, 1999, 12:25 PM
MFC controls and dialog boxes are CWnd types which contain the public member variable m_hWnd of type HWND. You can also use the member function GetSafeHwnd() to return the m_hWnd.