• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 303
  • Last Modified:

Using CProgressCtrl and a Cancel Button

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
selen
Asked:
selen
1 Solution
 
luisrCommented:
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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now