G
Guest
Our product supports Win2K, Windows XP and Vista. We use VS2005 Professional
for development. Our product has 2 components: Service (running as a service)
and UI (user mode application).
We want to launch a process in user session from our service running in a
Local System account. This is accomplished by calling the CreateProcessAsUser
() API. The required process launches in the user’s session as expected.
However, if the process has a window associated with it, the window does not
appear on top of all open windows (works fine in Windows XP). In order to
set the window to foreground, we find the window handle using FindWindow ()
API and then explicitly set the window to foreground.
We tried launching certain generic applications like notepad.exe to confirm
this behavior and notepad.exe also does not get launched in the foreground.
Another problem we faced was when there are multiple windows associated with
a process and there is no parent-child relationship between those windows.
Hence setting just one window to foreground will not suffice.
We tried to use the STARTUPINFO structure used in CreateProcessAsUser () to
ensure the “setting to foreground†behavior but could not find suitable
options to accomplish the same.
So is there a way to ensure that all windows associated with a process
launched in user-session using CreateProcessAsUser () are launched in the
foreground?
for development. Our product has 2 components: Service (running as a service)
and UI (user mode application).
We want to launch a process in user session from our service running in a
Local System account. This is accomplished by calling the CreateProcessAsUser
() API. The required process launches in the user’s session as expected.
However, if the process has a window associated with it, the window does not
appear on top of all open windows (works fine in Windows XP). In order to
set the window to foreground, we find the window handle using FindWindow ()
API and then explicitly set the window to foreground.
We tried launching certain generic applications like notepad.exe to confirm
this behavior and notepad.exe also does not get launched in the foreground.
Another problem we faced was when there are multiple windows associated with
a process and there is no parent-child relationship between those windows.
Hence setting just one window to foreground will not suffice.
We tried to use the STARTUPINFO structure used in CreateProcessAsUser () to
ensure the “setting to foreground†behavior but could not find suitable
options to accomplish the same.
So is there a way to ensure that all windows associated with a process
launched in user-session using CreateProcessAsUser () are launched in the
foreground?