hi again

Sorry for my stupid post, I have read only the first part of the original
message.

Here is a sample code that works on MS platform... I can't test now on Linux

Josus.

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Diagnostics;

namespace processTest
{
 /// <summary>
 /// Descripci�n breve de Form1.
 /// </summary>
 public class Form1 : System.Windows.Forms.Form
 {
  /// <summary>
  /// Variable del dise�ador requerida.
  /// </summary>
  private System.ComponentModel.Container components = null;
  private Process process;

  public Form1()
  {
   //
   // Necesario para admitir el Dise�ador de Windows Forms
   //
   InitializeComponent();

   //
   // TODO: agregar c�digo de constructor despu�s de llamar a
InitializeComponent
   //
  }

  /// <summary>
  /// Limpiar los recursos que se est�n utilizando.
  /// </summary>
  protected override void Dispose( bool disposing )
  {
   if( disposing )
   {
    if (components != null)
    {
     components.Dispose();
    }
   }
   base.Dispose( disposing );
  }

  #region C�digo generado por el Dise�ador de Windows Forms
  /// <summary>
  /// M�todo necesario para admitir el Dise�ador. No se puede modificar
  /// el contenido del m�todo con el editor de c�digo.
  /// </summary>
  private void InitializeComponent()
  {
   //
   // Form1
   //
   this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
   this.ClientSize = new System.Drawing.Size(292, 266);
   this.Name = "Form1";
   this.Text = "Form1";
   this.Load += new System.EventHandler(this.Form1_Load);

  }
  #endregion

  /// <summary>
  /// Punto de entrada principal de la aplicaci�n.
  /// </summary>
  [STAThread]
  static void Main()
  {
   Application.Run(new Form1());
  }

  private void Form1_Load(object sender, System.EventArgs e)
  {
   this.process = new System.Diagnostics.Process();
   this.process.EnableRaisingEvents = true;
   this.process.StartInfo.FileName = "notepad.exe";
   this.process.Start();
   this.process.Exited += new EventHandler(this.process_Exited);
  }

  private void process_Exited(object sender, EventArgs e)
  {
   MessageBox.Show("IExplorer.exe finaliz� su ejecuci�n");
   this.process.Dispose();
   this.process = null;
  }
 }
}


----- Original Message ----- 
From: "Jose Luis Garcia" <[EMAIL PROTECTED]>
To: "Ecmel Ercan" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Monday, October 27, 2003 11:02 AM
Subject: Re: [Mono-list] System.Diagnostics.Process.Exited Event


> hi,
>
>     Without your code i thing it's posible you're not enable the process
to
> raise events...
>
>    process.EnableRaisingEvents = true;
>
> Josus.
>
> ----- Original Message ----- 
> From: "Ecmel Ercan" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Saturday, October 25, 2003 8:13 PM
> Subject: [Mono-list] System.Diagnostics.Process.Exited Event
>
>
> > Hi,
> >
> > Hope I am posting to the correct list.
> >
> > I try to execute a process by using the System.Diagnostics.Process
class.
> >
> > Everything works fine but the System.Diagnostics.Process.Exited Event
does
> > not fire when the process finishes.
> >
> > I set System.Diagnostics.Process.EnableRaisingEvents to true.
> >
> > I am using mono 0.28
> >
> > Hope someone can help.
> >
> > Best Regards,
> > Ecmel Ercan
> >
> >
> > _______________________________________________
> > Mono-list maillist  -  [EMAIL PROTECTED]
> > http://lists.ximian.com/mailman/listinfo/mono-list
> >
>
> _______________________________________________
> Mono-list maillist  -  [EMAIL PROTECTED]
> http://lists.ximian.com/mailman/listinfo/mono-list
>

_______________________________________________
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list

Reply via email to