?
Solved

Close Application Requestion

Posted on 2011-02-16
4
Medium Priority
?
374 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 1200 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 600 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 200 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

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

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.
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
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…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

765 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