好象还存在问题啊,我在程序的InitInstance中执行下面的代码,但是未能等待notepad.exe结束程序就往下继续执行了.....HINSTANCE hi = ShellExecute(m_pMainWnd->m_hWnd, "open", "notepad.exe", "c:\\boot.ini", "", SW_SHOW); DWORD dwRtn = WaitForSingleObject(hi, INFINITE);dwRtn = WAIT_FAIL; GetLastError() = 5, Access is denied.我看了一下WaitForSingleObject的帮助: Windows NT/2000: The handle must have SYNCHRONIZE access. For more information, see Standard Access Rights.我想问题肯定存在这个地方,但是怎样才能让这个handle具有SYNCHRONIZE的访问权限啊???
DWORD dwRtn = WaitForSingleObject(hi, INFINITE);dwRtn = WAIT_FAIL;
GetLastError() = 5, Access is denied.我看了一下WaitForSingleObject的帮助:
Windows NT/2000: The handle must have SYNCHRONIZE access. For more information, see Standard Access Rights.我想问题肯定存在这个地方,但是怎样才能让这个handle具有SYNCHRONIZE的访问权限啊???