Window handle in MFC?

how to get window handle in mfc?

+3
source share
7 answers

This is m_hWnd member of your CWnd.

+8
source

CWnd :: GetSafeHwnd is a bit “safer” because it can be used with a NULL pointer CWnd http://msdn.microsoft.com/en-US/library/d64ehwhz%28v=vs.80%29.aspx

+7
source

CWnd::GetSafeHwnd(), HWND CWnd; CWnd::FromHandle HWND CWnd.

+4

: -, - m_hWnd CWnd, .

, API FindWindow windows. :

HANDLE hWind = FindWindow( your_win_class_name, your_win_name );
+1

"getsafeHwnd", c,

0

HANDLE hwnd = FindWindowW (__in_opt LPCWSTR lpClassName, __ in_opt LPCWSTR lpWindowName);

the first is the class name "Button" or "Edit control"; the second is the name of the window. Handler window (m_hWnd).

0
source

Gain access to m_hWnda member of your CWndexample:

HWND Handle = this->m_hWnd
-1
source

Source: https://habr.com/ru/post/1754800/


All Articles