ds-blue-logo
Preview  |  SOLIDWORKS USER FORUM
Use your SOLIDWORKS ID or 3DEXPERIENCE ID to log in.
JSJosano Soares10/06/2010

Staff,

Does anyone know how I explain the process of closing solidworks after finishing the execution of a program stand alone?
After finishing the program, closing the same but the process continues sldworks.exe running, I used to using System.Diagnostics in order to kill the process but for some reason did not work.
Below the code of the button to close the process.

        private void Button2_Click (object sender, EventArgs e)
        (
            Process [] processes = Process.GetProcessesByName ("SLDWORKS.exe");
            foreach (Process process in processes)
            (
                processo.CloseMainWindow ();
                processo.Kill ();
            )
            this.Close ();
        )

Regards,

Josano