Solved

Closing Popup windows on taskbar

Posted on 1998-12-27
2
189 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

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: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
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.
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.

920 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

16 Experts available now in Live!

Get 1:1 Help Now