Solved

Using CProgressCtrl and a Cancel Button

Posted on 1999-01-20
1
268 Views
Last Modified: 2013-11-20
I am trying to create a dialog that is very similar to a standard windows progress dialog.  On my dialog, I have a cancel button.  How can I perform a continuous action upon opening the dialog until the user presses the cancel button?  I have tried using PeekMessage but can't seem to get the application to Yield.  I currently have a processing loop in the Timer so that I can start the timer after the dialog is initialized and displayed.  Is there somewhere else I should be doing the processing?  How do I allow the cancel button to be pressed while in my processing loop and then detect that it was pressed?  Thanks in advance for any input!
0
Comment
Question by:selen
1 Comment
 
LVL 3

Accepted Solution

by:
luisr earned 100 total points
ID: 1328062
Some time ago I developed a little framework for doing this. I never released it, but I'm willing to share it to you. Send e-mail to me at luisr@iname.com if you are interested.

The way it works is that you create the dialog on the main thread and creates a new thread for the code that can be canceled. It's very simple to use.

I think this little framework is exactly what you need.
0

Featured Post

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

Suggested Solutions

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 …
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.

831 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