CreateProcessAsUser in Foreground

Hi I have created a windows service that is using createProcessAsUser to create a process as the logged in user. This works fine and I can open applications such as notepad as the logged in user. The problem is that they do not appear in the foreground (behind all other windows).

Any help please?

Note: I have attempted the following
startupinfo.dwFlags = STARTF_USESHOWWINDOW;
startupinfo.wShowWindow = SW_SHOWNORMAL;

also tried,
AllowSetForegroundWindow(hdle);
SetForegroundWindow(hWnd);
ShowWindow(hWnd, SW_SHOW);
SetWindowPos(hWnd, 0, 0, 0, 320, 240, SWP_NOMOVE | SWP_NOSIZE);
SetFocus(hWnd);
Last edited on
Topic archived. No new replies allowed.