//**********************************************************************
//如何控制可执行程序的执行(等待外部可执行程序运行完毕)
SHELLEXECUTEINFO ShExecInfo;
memset(&ShExecInfo,0,sizeof(SHELLEXECUTEINFO));
ShExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
ShExecInfo.fMask = SEE_MASK_NOCLOSEPROCESS;
ShExecInfo.hwnd = NULL;
ShExecInfo.lpVerb = NULL;
ShExecInfo.lpFile = "c://MyProgram.exe";
ShExecInfo.lpParameters = "";
ShExecInfo.lpDirectory = NULL;
ShExecInfo.nShow = SW_SHOW;
ShExecInfo.hInstApp = NULL;
::ShellExecuteEx(&ShExecInfo);
if(ShExecInfo.hProcess)
{
::WaitForSingleObject(ShExecInfo.hProcess,INFINITE);
::CloseHandle(ShExecInfo.hProcess);
}
//**********************************************************************
//得到系统分辨率
GetSystemMetris(SM_CXSCREEN);
GetSystemMetris(SM_CYSCREEN);
//**********************************************************************
CRect rect;
GetWindowRect(&rect); //取窗口大小
GetClientRect(&rect); //取客户区大小
ClientToScreen(&rect); //客户区转到屏幕
ScreenToClient(&rect); //屏幕转到客户区
//**********************************************************************
AfxGetMainWnd()->SetWindowText("Application Title"); //更改应用程序主窗口标题
GetParentFrame()->SetWindowText("MDI Child Frame Title"); //更改MDI子窗口
GetDlgItem(IDC_BUTTON)->SetWindowText("Control Title"); //更改对话框控件标题
//**********************************************************************
//二维数组
char **level;
//构造
level = new char * [width];
for(int x = 0;x < width; x++)
level[x] = new char [height];
//释放
for(int x = 0;x < width; x++)
delete level[x];
delete [] level;
//**********************************************************************
//阻止窗体按下Enter或Esc后就退出
1.把OnOK()与OnCancle()掏空。注意函数架子别去掉
2.在你要退出dlg的地方调用CDialog::OnOK()或OnCancel()既可