The following method checks to see if an instance of a specific application is running.....
using System.Diagnostics;
private bool CheckIfPPlusOpen()
{
Process[] pApps = Process.GetProcesses();
bool bPPlus = false;
foreach (Process p in pApps)
{
if (p.ProcessName.Equals("P+Test"))
{
bPPlus = true;
}
}
if (!bPPlus)
{
GetPPlusAbsenceData();
}
else
{
MessageBox.Show("Please close P+ before refreshing the P+ data!", "Close P+", MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
return bPPlus;
}
Showing posts with label Process. Show all posts
Showing posts with label Process. Show all posts
Thursday, 9 October 2008
Subscribe to:
Posts (Atom)