MFC split window_get view window handle

Problem description After
MFC splits the window, when one window is clicked, the other window will be in an inactive state. To call the function of another window from one window, you need to pass the handle to it. It took a long time to find a solution...

solution

//GetPane能够获得所需要句柄分割的那一半
//CDPView是要获得句柄的那一个视图
CSplitterWnd *ps = (CSplitterWnd*) GetParent();
CDPView*pv = (CDPView*)(ps->GetPane(0,0));
pv->m_hWnd;

Guess you like

Origin blog.csdn.net/qq_40247982/article/details/106615458