[Mono-osx] Monitoring external processes

Andrew Coupe Andrew at eVirtualStudio.com
Thu Oct 2 13:57:53 EDT 2008


Could someone from the dev team comment on this issue as it appears to be
specific to the Mac runtime?  Process.HasExited works fine on Mono 2 for
Windows.  Are there any workarounds for detecting the status of currently
running process?

 

Thanks for your help.

 

From: mono-osx-bounces at lists.ximian.com
[mailto:mono-osx-bounces at lists.ximian.com] On Behalf Of Andrew Coupe
Sent: Sunday, September 28, 2008 12:01 PM
To: mono-osx at lists.ximian.com
Subject: Re: [Mono-osx] Monitoring external processes

 

I forgot to include the error produced by the Mono runtime on the mac.

 

mono(333,0xa000ed88) malloc: ***  Deallocation of a pointer not malloced:
0x1a5898; This could be a double free(), or free() called with the middle of
an allocated block; Try setting environment variable MallocHelp to see tools
to help debug

 

 

Hi all

 

I need to detect when the user closes a process that my application
launches.  The following code works fine under .NET and Mono 2.0 on Windows
but does not work on the Mac OS.  On the mac, the process correctly starts
the texeditor app.  The problem is that HasExited incorrectly returns true
immediately even though the window has not been closed.

 

Dim Progname As String =
Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory) +
m_PATHDELIMITER + "Myfile.txt"

        Dim DAWproc As New Process()

            With DAWproc.StartInfo

                .FileName = Progname

                .Verb = "Open"

                .CreateNoWindow = True

            End With

            DAWproc.Start()

            While Not DAWproc.HasExited 

            End While

            MessageBox.Show("App Closed")

 

I've already tried using GetProcessbyname but, according to other threads on
this forum,  it appears that this function is not functioning correctly
under Mono either.  Can anyone suggest how I can accomplish this seemingly
simple task in a reliable way that works on both Mac and Windows?

 

Thanks in advance.

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-osx/attachments/20081002/329882d9/attachment.html 


More information about the Mono-osx mailing list