Solved

Using CProgressCtrl and a Cancel Button

Posted on 1999-01-20
1
272 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

856 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