Solved

Close Application Requestion

Posted on 2011-02-16
4
364 Views
Last Modified: 2012-05-11
Hi,

I am developing an application that should be close for another one. I mean, I have my APP1.exe running (could exist only one APP1.exe or a several running at the same time) that must be closed by a command button in APP2.exe.

How can I do that considering the following constraint condition?
1) I do not want to use files
2) I do not want to use queue message
3) I do not want to use any networking?

I tought to use some SendMessage to all APP1.exe running, but how to do that? Any other idea will be welcome as well.

Thanks,

0
Comment
Question by:jr_barros_jr
[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
4 Comments
 
LVL 13

Accepted Solution

by:
gamarrojgq earned 300 total points
ID: 34906944
Hi,

You can do it like this

        Dim objProcess() As Process = System.Diagnostics.Process.GetProcessesByName("App1")

        For Each p As Process In objProcess
            p.Kill()
        Next
0
 
LVL 33

Assisted Solution

by:Todd Gerbert
Todd Gerbert earned 150 total points
ID: 34906976
Using Process.Kill() will forcefully close instances of App1 (which might be okay), or you can use Process.CloseMainWindow() - which has the same effect as if the user had closed the main window of each App1, which means App1 would have a chance to shutdown gracefully.

http://msdn.microsoft.com/en-us/library/system.diagnostics.process.closemainwindow.aspx
0
 
LVL 25

Assisted Solution

by:Luis Pérez
Luis Pérez earned 50 total points
ID: 34906994
Try this:

        Dim processList As Process() = Process.GetProcessesByName("App1")
        For Each uProcess As Process In processList
            uProcess.Kill()
        Next
0
 
LVL 25

Expert Comment

by:Luis Pérez
ID: 34906996
Ooops... too late.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
how to check mis-spellings in a select SQL 2 38
Vb.net progressbar with timer1 in visual studio win app 11 37
c#, case, if 4 19
Stop Git from being my repository 1 23
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
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