Solved

Check if Enterprise Manager is open

Posted on 2006-11-22
2
226 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:
mnasman 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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
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.
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…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

707 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now