Solved

Check if Enterprise Manager is open

Posted on 2006-11-22
2
230 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 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

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

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…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

749 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