ObjectARX学习笔记(十四)--枚举CAD命令行子窗口acedGetAcadTextCmdLine();

CWnd *wTextCmdLine = acedGetAcadTextCmdLine(); 

if (wTextCmdLine != NULL)

 {

 ::EnumChildWindows(wTextCmdLine->m_hWnd,EnumChildProc,0); 

}

 BOOL CALLBACK EnumChildProc(HWND hWnd,LPARAM lParam)

{

WCHAR lpWinTitle[256];

 ::GetWindowText(hWnd,lpWinTitle,256-1); 

CString m_strTitle;

m_strTitle.Format(_T("%s"),lpWinTitle);

MessageBox(NULL,m_strTitle,_T("cwnd"),MB_OK);

WCHAR lpWinTitle2[256];

 ::GetClassName(hWnd,lpWinTitle2,MAX_PATH-1);

MessageBox(NULL,lpWinTitle2,_T("cwnd"),MB_OK);

/*命令行会有三个子窗口*/return true;

}
 

posted @ 2020-03-01 22:45  中国膜结构网mjgou  阅读(347)  评论(0编辑  收藏  举报