Click here to Skip to main content
15,849,615 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I want to close all the running windows, how to do this? Thank you.
Sergey Alexandrovich Kryukov 9-Jan-12 21:03pm    
Well... please: platform, what UI library are you using..?
Andrewpeter 9-Jan-12 21:14pm    
Hi SAKryukov, I use Win7 and VC++6.0 to code. What the way to do this? Thanks.
DrBones69 9-Jan-12 21:11pm    
Well...Uh??...The power button, ofcourse.

You could try enumerating all windows using EnumWindows and then send it the WM_CLOSE message using SendMessage.
Windows that ignore the WM_CLOSE message would still not close.
Share this answer
refer to this article
Share this answer
Thank pguimalan and _Superman_, but I need close all the running windows, not an app (window). Thank. Please help me.
Share this answer
[no name] 9-Jan-12 23:24pm    
This is not an answer.
Chandrasekharan P 10-Jan-12 0:24am    
Can you explain all running windows? Do you want to close all the windows in a application?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900