void CTransFileDlg::OnClose()
{
//方法一:
char buf[256];
::GetModuleFileName(NULL,buf,sizeof(buf));
CString strPath = buf;
ShowWindow(SW_HIDE);//隐藏本对话框
WinExec(strPath, SW_SHOW);//启动strPath路径下的执行文件
//方法二:
char pBuf[MAX_PATH];
//获取应用程序完全路径,比 GetCurrentDirectory 好用多了
GetModuleFileName(NULL,pBuf,MAX_PATH);
STARTUPINFO startupinfo;
PROCESS_INFORMATION proc_info;
memset(&startupinfo,0,sizeof(STARTUPINFO));
startupinfo.cb=sizeof(STARTUPINFO);
// 最重要的地方
if(m_bSetRestart)
::CreateProcess(pBuf,NULL,NULL,NULL,FALSE,
NORMAL_PRIORITY_CLASS,NULL,NULL,&startupinfo,&proc_info);
CDialog::OnClose();
}