Start IE from Windows Service? - Programmers Heaven

Howdy, Stranger!

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

Categories

Start IE from Windows Service?

RFicklingRFickling Posts: 14Member
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

  • non-monotonicnon-monotonic Posts: 17Member
    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

  • ctranctran Posts: 1Member
    : 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.
  • open_source_iropen_source_ir Posts: 2Member
    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.