Solved

Closing other windows

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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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.
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

630 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