Solved

Closing other windows

Posted on 2000-04-29
3
180 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Decoding 32 bit binary streams 6 37
Different colored text in ComboBox without Subclassing 8 55
substring method in java 1 98
firstChar challenge 13 110
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 Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
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.

867 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

21 Experts available now in Live!

Get 1:1 Help Now