I am new for c# developer and I tried to close my window application with following code. I hide close button of form and add user defined button to close application.
private void closeBtn_Click(object sender, EventArgs e)
{
System.Environment.Exit(0);
//Environment.Exit(1);
//Application.Exit();
//this.Close();
}
But process still running on Task Manager. Actually I am calling this application from Window service. But application is not closing properly.
private void callback(Object state)
{
string strAppPath;
strAppPath = @"D:\VSPythonProject\Reminder_WApp\Reminder_WApp\bin\Debug\Reminder_WApp.exe"; //System.Environment.GetFolderPath(System.Environment.SpecialFolder.ProgramFiles) +
System.Diagnostics.Process.Start(strAppPath);
ApplicationLoader.PROCESS_INFORMATION procInfo;
ApplicationLoader.StartProcessAndBypassUAC(strAppPath, out procInfo);
}