CreateProcessAsUser vs ShellExecute
问题 I need to ShellExecute something as another user, currently I start a helper process with CreateProcessAsUser that calls ShellExecute , but that seems like too much of a hack (Wrong parent process etc.) Is there a better way to do this? @PabloG: ImpersonateLoggedOnUser does not work: HANDLE hTok; VERIFY(LogonUser("otheruser",0,"password",LOGON32_LOGON_INTERACTIVE,LOGON32_PROVIDER_DEFAULT,&hTok)); VERIFY(ImpersonateLoggedOnUser(hTok)); ShellExecute(0,0,"calc.exe",0,0,SW_SHOW); RevertToSelf();