Howdy, Stranger!

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

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

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#, opensource-iranian@yahoo.com , 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.