HWND hOtherWnd = ::FindWindow(_T("xxxxxx"),_T("xxxxxx"));
HANDLE hApp;
DWORD dProcess;
::GetWindowThreadProcessId(hOtherWnd,&dProcess);
hApp= OpenProcess(PROCESS_VM_OPERATION|SYNCHRONIZE,FALSE,dProcess);
//::SendMessage(hOtherWnd,WM_DESTROY,0,0);
::WaitForSingleObject(hApp,INFINITE);// 等待程序关闭