Solved

Closing Popup windows on taskbar

Posted on 1998-12-27
2
188 Views
Last Modified: 2013-11-20
There is a hurdle i have encountered in closing all the programs. I would like to close only pop-up windows i.e. those programs which appear on the TaskBar. Also,
if any program asks for the Save dialog before quitting, then the default selection or 'Yes' should be automatically selected before closing the program without user's intervention. Please help me complete this program.

0
Comment
Question by:lordbeachboy
2 Comments
 
LVL 86

Expert Comment

by:jkr
ID: 1326768
Quote from 'http://www.experts-exchange.com/topics/comp/os-ms-windows/programming/mfc/Q.10111542' aka 'EnumWindows' in the MFC Programming Area (obviously by you using a differnt login!)
Q:
I would like to thank the experts jkr and zyqwert for helping me
solve the Enumwindows problem.
Now, there is another hurdle i have encountered in closing all the programs. I would like to close only pop-up windows i.e. those programs which appear on the TaskBar. Also,
if any program asks for the Save dialog before quitting, then the default selection or 'Yes' should be automatically selected before closing the program without user's intervention. Please help me complete this program.
C:
NatasBoy - this is a completely different task ;-)
But anyway, responding to 'Save' dialogs is difficult to accomplish automatically - just consider that the 'OK' or 'Save' button (you already see it) may be named arbitrarily, it is also hard to find out what dialog control code it uses (well, this can be done easily for MFC applications, as the use the same conventions, but is almost impossible for 'unknown' apps)

Don't try to cheat here at  EE using multiple accounts - and, please, don't do that so obvious ;-)
0
 

Accepted Solution

by:
dagangwang earned 40 total points
ID: 1326769
1. Use "EnumWindows" function to enum all windows;
2. In enum callback function, you handle all windows that   have "WS_EX_TOOLWINDOW"
    style,  post "WM_CLOSE" message to these windows ;
3. Automatically selection is not a possibility;
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

746 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

11 Experts available now in Live!

Get 1:1 Help Now