Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Close Application Requestion

Posted on 2011-02-16
4
Medium Priority
?
378 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

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

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

If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

650 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