1.在vista, Windows 7 下用
::CreateProcess 存在第一次运行权限问题,所以当时采用了ShellExecute
		
		
				
				 
		
				CreateProcess可以创建当前进程的子进和,可以继承当前进程的内核句柄。   
Winexec,ShellExecute可以创建与当前进程不同地址空间的进程   
		
		
				
				 
		
				LRESULT OnRepair(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
 
 CPath   pathFile;
 //获取当前路径
 ::GetModuleFileName(NULL, pathFile.m_strPath.GetBuffer(MAX_PATH * 2), MAX_PATH * 2);
		
		
				
				 
		
				 pathFile.m_strPath.ReleaseBuffer();
 pathFile.RemoveFileSpec();
 pathFile.Append(L"setupwiz.exe");
 
 ::ShellExecute(NULL,L"open", pathFile.m_strPath, L"install.xml /p", NULL, SW_SHOWNORMAL);
 //关闭窗口
 EndDialog(-1);  
 return 0;
}
		
	posted on 2009-04-12 23:39 
-274°C 阅读(1095) 
评论(0)  编辑  收藏  所属分类: 
C++