0

I saw that many people asked this question but it just does not work for me!

try
{                      
    ProcessStartInfo startInfo = new ProcessStartInfo();
    startInfo.FileName = @"C:\Program Files\Internet Explorer\iexplore.exe";
    startInfo.Arguments = Url.ToString();
    startInfo.CreateNoWindow = true;
    startInfo.ErrorDialog = false;
    startInfo.UseShellExecute = false;
    startInfo.WindowStyle = ProcessWindowStyle.Hidden;

    Process.Start(startInfo);
}
catch (Win32Exception ex)
{
    var err = ex.ToString();
}

It still opens the browser ! anybody can say why?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Michael meshaev
  • 31
  • 1
  • 11
  • Use [cURL](https://curl.haxx.se/) to download from a URL in the background without creating a window. – Brandon Oct 13 '16 at 14:49
  • Brandon, thanks for the idea... but i would like to know why the code still opens the IE? i saw on MSDN the same code, but somehow it still opens the browser for me. can you see why? – Michael meshaev Oct 13 '16 at 14:53
  • is your goal to know why? or to know how to get a hidden IE window? – BobbyTables Oct 13 '16 at 14:57
  • Can you comment the MSDN link? – Brandon Oct 13 '16 at 15:02
  • first of all i need to get the hidden explorer. and second i have to understand why it doesnt work, im working on it 2 days and i have to understand where do i get wrong?? it makes me frustrated.... – Michael meshaev Oct 13 '16 at 15:02
  • [There's](http://stackoverflow.com/questions/31402342/start-hidden-internet-explorer) a [bunch](http://stackoverflow.com/questions/18427324/handle-ie-to-filling-a-form-c-sharp/18427724#18427724) of [other](http://stackoverflow.com/questions/19133531/opening-a-hidden-internet-explorer-window-without-it-getting-focus) [questions](http://stackoverflow.com/questions/18427324/handle-ie-to-filling-a-form-c-sharp/18427724#18427724) on SO about this. I'd try one of those. – Brandon Oct 13 '16 at 15:06
  • @Brandon here is one of the articles from the [MSDN](https://msdn.microsoft.com/en-us/library/system.diagnostics.processstartinfo.createnowindow.aspx) its about the CreateNoWindow. ill check about the ProcessWindowStyle.Hidden – Michael meshaev Oct 13 '16 at 15:35
  • CreateNoWindow is only for console apps. Apparently IE is not a console application. – Nathan Oct 13 '16 at 16:15

0 Answers0