473,382 Members | 1,814 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Close an app from another app

I am finding the windows handle for an application using the FindWindow() call. I need to then close that application if it is running. Any suggestions on how I should do this? I tried to use the CloseHandle() call, but that doesn't seem to work. Maybe I am just doing something wrong, or maybe I need to use a different method. Can anyone help? Thanks
Nov 16 '05 #1
2 1460
Hi Susan

You can send a message to the window using the WM_CLOSE message. Check the following links out which exactly does what you want

http://www.mangovision.com/vbapi/ref/w/wm_close.htm

Hope this helps

Regards
Madh

MVP | MCSD.NE

----- Susan wrote: ----

I am finding the windows handle for an application using the FindWindow() call. I need to then close that application if it is running. Any suggestions on how I should do this? I tried to use the CloseHandle() call, but that doesn't seem to work. Maybe I am just doing something wrong, or maybe I need to use a different method. Can anyone help? Thanks
Nov 16 '05 #2
Do you have any C# examples?
Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: drs | last post by:
Hi, I have a program which opens a socket server in a thread. I need for the server to listen on the socket for a certain amount of time (say, ten seconds or so) and then close it, and am...
4
by: -DRB- | last post by:
Hi, I'm probably going to get harassed just for mentioning the unmentionable, but since I have if anyone could answer this question that would be much appreciated. As per the rather long...
4
by: Raymond Wilk | last post by:
I used javascript to open a new window, then used the following to close the new window on the next click: <body onBlur="self.close()" onClick="self.close()" bgcolor="#FFFFFF"> On the new window...
9
by: MacDermott | last post by:
I have an Access MDB which instantiates a class in a custom DLL, manipulates it for a while, then sets it equal nothing. The MDB does other things,too, and generally behaves itself as desired....
5
by: Viper | last post by:
.... say, like MS Word opens another instance of himself when you open another document. If you close the first 'Word', the second document remains alive. I can't figure out how to do the same...
2
by: Bruce Wiebe | last post by:
hi all im having a problem accessing a text file on my hard disk after ive created it and added some text to it it would appear that the file is still locked. What happens is this i have...
7
by: Alice | last post by:
Hi, In my program, the user can navigate to many different forms. When they go to the next form, I want the form they have left to close. However, the forms aren't closing. Can anyone tell me...
6
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - How do I close a window and why does it not work on the first one?...
2
by: richard | last post by:
Help with with the API - Calling Windows Choose Font Dialog Found on The Access Web http://www.mvps.org/access/api/api0061.htm The code was originally written by Terry Kreft, and modified...
3
by: godhulirbalaka | last post by:
Dear Sir/Madam, I am new vb 6.0 user. I am developing Shop Management Program. I have a main form with buttons and menus. when i click any button then respective form is open. I want to set a...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.