0

I have a command that i need run by cmd.exe when something happens in my program. Let's say the command is "calc.exe". When i use ShellExecute:

HWND win = GetActiveWindow();
ShellExecute(win,L"open",L"calc.exe",L"",L"", SW_SHOWNORMAL );

The calc.exe process starts in session 0 so i cannot see it. Is there any way to set it to start in the active users window? I don't want to use CreateProcess as I have been having privilege issues with it

Thanks

user966890
  • 205
  • 1
  • 7
  • 15
  • what you mean by "session"? –  Dec 05 '12 at 11:33
  • ive edited the qustion. but basically i could see from task manager thatthe calc.exe process is running in session 0(so cant see it). i want it to run in the active users window – user966890 Dec 05 '12 at 11:37

1 Answers1

0

No. ShellExecute cannot run a program in another session. You'll need to use CreateProcessAsUser. There are numerous questions on here that discuss how to do this.

Roger Lipscombe
  • 89,048
  • 55
  • 235
  • 380