mfc how to get window handle?
There are two methodes: First one, you can use the m_hWnd member variable of your CWnd class to get the window handle. HANDLE hwnd =FindWindowW( __in_opt LPCWSTR lpClassName,__in_opt LPCWSTR lpWindowName); first one is class name "Button" or "Edit control" second one is window name. Handler of the window (m_hWnd).