SDI: CFrameWnd::GetActiveView MDI: CMDIFrameWnd *pFrame = (CMDIFrameWnd*)AfxGetApp()->GetMainWnd();// Get the active MDI child window. CMDIChildWnd *pChild = (CMDIChildWnd*)pFrame->GetActiveFrame();// or CMDIChildWnd *pChild = pFrame->MDIGetActive();// Get the active view attached to the active MDI child window. CMyView *pView = (CMyView*)pChild->GetActiveView();
CMDIFrameWnd *pFrame = (CMDIFrameWnd*)AfxGetApp()->GetMainWnd();// Get the active MDI child window.
CMDIChildWnd *pChild = (CMDIChildWnd*)pFrame->GetActiveFrame();// or CMDIChildWnd *pChild = pFrame->MDIGetActive();// Get the active view attached to the active MDI child window.
CMyView *pView = (CMyView*)pChild->GetActiveView();
应该先获取到句柄再做为参数传给目标线程
这里有一个例子可以参考一下
http://blog.csdn.net/xianglitian/article/details/6729851