Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 219
  • Last Modified:

Closing other windows

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
scooter1
Asked:
scooter1
  • 2
1 Solution
 
SamHobbsCommented:
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
 
shaigCommented:
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
 
SamHobbsCommented:

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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now