Hi,
"uuyytt" <uu****@hotmail.comwrote in message
news:eo**************@TK2MSFTNGP03.phx.gbl...
>I have a Windows service from which I want to start Internet Explorer with
a particular URL as an argument. I don't know why my code (shown below)
doesn't work. I know that IExplore.exe starts as I can see it in my task
manager, but it is not visible. Can anyone explain what is happening?
My code:
Process p = Process.Start("IExplore.exe", m_strURL);
NT Services do not have access to the interactive desktop by default.
Windows NT and above have the concept of window stations. Your logon session
has a window station and your service has its own. So they both have a
windows desktop of their own and you can only see yours. If your service
runs as local system you can use service control manager to give that
service access to the interactive desktop. So that might help but only for a
little while I guess because if you connect to that server with remote
desktop your remote session will live in just another window station.
My advice is to change your design. Split up your service's functionality to
start processes in another app which is run manually by the user. You might
add it to the startup group to get it auto started after a user logged in.
Then use some IPC mechanism (remoting, sockets, COM) to communicate between
your service and the user app, so that the service can tell your user app to
start some processes.
--
SvenC