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;
}
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment