Solved

Closing other windows

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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
VBA "SendKeys" Syntax for Multiple Keystrokes 7 117
EvenOdd challenge 10 128
Fibonacci challenge 11 133
Detect file exist or not 3 181
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

820 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