How do I stop a do/while loop using a toolbar
-
Hi, My program needs to stop a do/while loop when the user decides it. I first use a progress dialog bar which works great but it is not convinient. I would like to stop a do/while loop using a button of my toolbar. How can I tell the program to spend sometime checking on the toolbars and menu while it is running within the loop? Thanks, :confused:RNO
-
Hi, My program needs to stop a do/while loop when the user decides it. I first use a progress dialog bar which works great but it is not convinient. I would like to stop a do/while loop using a button of my toolbar. How can I tell the program to spend sometime checking on the toolbars and menu while it is running within the loop? Thanks, :confused:RNO
I use something like this to detect if the user presses a button inside a loop: MSG msg; while(PeekMessage(&msg,NULL,0,0,PM_REMOVE)) { TranslateMessage(&msg); DispatchMessage(&msg); } jhaga --------------------------------- Do not hire a man who does your work for money, but him who does it for love of it. Go confidently in the direction of your dreams! Live the life you've imagined. As you simplify your life, the laws of the universe will be simpler. Do not be too moral. You may cheat yourself out of much life. Aim above morality. Be not simply good; be good for something. -Henry David Thoreau-
-
Hi, My program needs to stop a do/while loop when the user decides it. I first use a progress dialog bar which works great but it is not convinient. I would like to stop a do/while loop using a button of my toolbar. How can I tell the program to spend sometime checking on the toolbars and menu while it is running within the loop? Thanks, :confused:RNO
I think the normal thing to be done in this case is running your do/while loop in a separate thread so you can handle all the messages, including toolbar notifications, from the main application thread normally. Your while loop condition should check on a global variable that is to be changed by the toolbar message to fail the condition.