Solved

Closing other windows

Posted on 2000-04-29
3
167 Views
Last Modified: 2013-11-20
Will useing:
 ::SendMessage(hWndCurr, WM_CLOSE, 0, 0);

where hWndCurr is the handle to anywindow that isn't part of my program, harm anything...such as memory and will the program close correctly??
0
Comment
Question by:scooter1
  • 2
3 Comments
 
LVL 3

Accepted Solution

by:
SamHobbs earned 5 total points
ID: 2763166
What happens is dependent upon the program, but it should normally be a safe way to tell a program to end. Some programs, though, might display a dialog box asking if a file should be saved.
0
 
LVL 3

Expert Comment

by:shaig
ID: 2763231
The program will close currectly if it was programed to do so, I guess in most cases it will.
It would be best if you know the main window of the program you are trying to close and try to address him.

WM_CLOSE is the proper way to achive yoor goal.
0
 
LVL 3

Expert Comment

by:SamHobbs
ID: 2764049

There are some Microsoft Knowledge Base articles that can help. I will explain how to find them so you will be able to get much more help on many other things.

go to http://support.microsoft.com/servicedesks/msdn/search/default.asp

In step 1, select "Windows 32-bit SDK".

In step 2, use the default (keyword search using all words).

In step 3 ("My Queston is"), use "WM_CLOSE" (without quotes).

In "Search Options", use the "Title and excerpts" button.

You will get a few articles, some of which will be useful.

Next, do the same thing again, except in step 1, select "Visual C++" instead of "Windows 32-bit SDK".
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

758 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now