1. 정적 멤버 변수 사용
다른 창에서 정적 멤버 변수 static ms_str을 설정하고
액세스하려는 컨트롤의 내용을 정적 멤버 변수에 미리 할당하여 클래스 이름을 통해 데이터에 액세스할 수 있도록 합니다.
SetDlgItemText(IDC_STATIC1, COtherDlg::ms_str); //COtherDlg其他窗口类名
2. 창 핸들 사용
CString str1;
HWND hWnd = ::FindWindow(NULL, _T("其他窗口的名称")); //获取窗口的句柄
COtherDlg* pWnd = (COtherDlg*)COtherDlg::FromHandle(hWnd);//由句柄得到对话框的对象指针,COtherDlg其他窗口类名
CEdit* pEdit = (CEdit*)pWnd->GetDlgItem(IDC_EDIT1); //获取其他窗口控件
pEdit ->GetWindowText(str1); //获取控件内容