Re: Exception launcing processes



Probabibly I should be explicit, however I'm developing for Mobile,
this code is fulli supported by WinCE.

Andrea

Paul G. Tobey [eMVP] ha scritto:

You realize that you posted this to a Windows CE, not a Windows desktop,
group? I think you'll have a better chance of getting good help in a
more-appropriate group.

Paul T.

<andrerus@xxxxxxxxx> wrote in message
news:1161297371.890676.30520@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi, I'd like understanding why, when I launch a process from inside my
application I receive or no an exception, depending on the program I
try to launch. This is the code I execute:

externApp = System.Diagnostics.Process.Start(fullnameApp, "");

IntPtr hwndExt = IntPtr.Zero;
do
{
System.Threading.Thread.Sleep(500);
externApp.Refresh();
hwndExt = externApp.MainWindowHandle; //this line throws
InvalidOperationException
}
while (hwndExt.Equals(IntPtr.Zero));

If fullnameApp = "/Windows/calc.exe", no exception occurr,
if instead fullnameApp = "/Windows/iexplore.exe" exception is thrown.

Analising both cases with debugging before executing the impeached line
I saw that in first case it has exited field and HasExited property =
false, instead in the latter, in a first moment exited field is false
and HasExited true, but then both became true, even if the process is
still alive.

Which is the reason of it?

Thanks,
Andrea


.



Relevant Pages

  • Re: Exception launcing processes
    ... Here are exception details: ... Paul G. Tobey ha scritto: ... I saw that in first case it has exited field and HasExited property = ... and HasExited true, but then both became true, even if the process is ...
    (microsoft.public.windowsce.app.development)
  • Re: Exception launcing processes
    ... Paul G. Tobey ha scritto: ... application I receive or no an exception, ... I saw that in first case it has exited field and HasExited property = ... and HasExited true, but then both became true, even if the process is ...
    (microsoft.public.windowsce.app.development)
  • Re: Exception launcing processes
    ... You realize that you posted this to a Windows CE, not a Windows desktop, ... I saw that in first case it has exited field and HasExited property = ... and HasExited true, but then both became true, even if the process is ...
    (microsoft.public.windowsce.app.development)
  • Exception launcing processes
    ... Hi, I'd like understanding why, when I launch a process from inside my ... I saw that in first case it has exited field and HasExited property = ... and HasExited true, but then both became true, even if the process is ...
    (microsoft.public.windowsce.app.development)
  • Re: Exception launcing processes
    ... Any chance that there's already a copy of iexplore running and that, ... Paul G. Tobey ha scritto: ... and HasExited true, but then both became true, even if the process ...
    (microsoft.public.windowsce.app.development)

Loading