08-06-2003 12:45 PM
08-11-2003 09:14 AM
MSG msg;
while (::PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE))
{
if (!::AfxGetThread()->PumpMessage())
return;
}
m_running = true;
for (int i = 0; i < 1000; ++i)
{
// If m_running is set to false via the stop button, break out of the loop.
if (!m_running)
break;
// Display the current iteration in the text box.
CNiString output;
output << i;
m_output.SetWindowText(output);
// Add a delay between each iteration of the loop.
::Sleep(200);
// Give Windows a chance to process messages (and handle stop button event).
DoEvents();
}
m_running = false;