Start IE from Windows Service?

Hi,

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);

Thanks,
Royce

Comments

  • Im not 100% sure about this so dont quote me on this unless of course im right :) I think the problem lies in the fact that windows services dont have access to the GUI thats why you cant display forms and such like from services. So maybe what is happening is because you are starting IE from your service context IE is also blocked from using the GUI.
    A slave to the code

  • : Hi,
    :
    : 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);
    :
    : Thanks,
    : Royce
    :
    :
    That's because your service does not have handle to desktop winstation. Search msdn for winstat0 for detail. You can also check "allow interactive with desktop" through SCM, but it is not recommented from Microsoft.
  • hi pal , just paste this code into ur button sub :

    System.Diagnostics.Process.Start("ur url for example textBox1.Text");

    when ur run this line automaticly internet explorer pops up n opens ur requested page , u can communicate me in learning c#, [email protected] , my name is Pedram , i ll be glad to help u n ask u my problems ,all the bests bye
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories