?
Solved

Check if Enterprise Manager is open

Posted on 2006-11-22
2
Medium Priority
?
232 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 22

Accepted Solution

by:
Mohammed Nasman earned 2000 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Article by: Ivo
C# And Nullable Types Since 2.0 C# has Nullable(T) Generic Structure. The idea behind is to allow value type objects to have null values just like reference types have. This concerns scenarios where not all data sources have values (like a databa…
Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
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…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses

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