10-10-2007 04:17 PM
10-10-2007 04:37 PM
10-10-2007 11:49 PM
Provided that Mert's suggestion is crucial, simply changing the control to indicator may help you to avoid control callback to be called when executing your long-lasting task without need to handle a global variable; control callback could then look like this one:
if (event != EVENT_COMMIT) return 0;
SetCtrlAttribute (panel, control, ATTR_CTRL_MODE, VAL_INDICATOR);
CmtScheduleThreadPoolFunction (...);
return 0;
After completion of the scheduled function you could PostDefferredCall a function to the main thread to restore normal control state.