Solved

Check if Enterprise Manager is open

Posted on 2006-11-22
2
228 Views
Last Modified: 2013-12-03
Hi,

Is there anyway I could detect if Enterprise Manager is open with c#?
0
Comment
Question by:JakeyCakes
2 Comments
 
LVL 22

Accepted Solution

by:
Mohammed Nasman earned 500 total points
ID: 17995297
Hello

   I made a simple method to check if there's an application running or not, it's based on the application title, so you can use it for any application you would like ;-)

====
bool AppIsRunning(string s)
            {
                  bool Found = false;
                  Process[] ps = Process.GetProcesses();                  
                  foreach(Process p in ps)                  
                        if(p.MainWindowTitle.StartsWith(s))
                        {
                              Found = true;
                              break;
                        }
                        else
                              Found =false;
                  
                  return Found ;
            }

            private void button1_Click(object sender, System.EventArgs e)
            {
            if(AppIsRunning("SQL Server Enterprise Manager"))
                        MessageBox.Show("SQL Server Enterprise Manager is running");
                  else
                        MessageBox.Show("SQL Server Enterprise Manager is not running");
            }


Best Regards
Mohammed Nasman
0
 

Author Comment

by:JakeyCakes
ID: 17995824
Thanks mnasman! The points are yours
0

Featured Post

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question