Example #1
0
static bool run(CKODEKDlg *that, enum state newHere) {
	if (newHere == ERRORBOX) {
		newHere = END;
		Error dlg;
		dlg.DoModal();
	}
	if (that->here != END && newHere == START) {
		return true;//not allowed!!
	}
	if(that->here != TERM) that->here = newHere;
	if (that != NULL) {
		if (that->here == END) {
			xundo();
			progress(&that->progressBar, 0);
			that->GetSafeOwner()->SetWindowText(_T("KODEK"));
		}
		that->seedEntry.EnableWindow(that->here == END);
		that->compressButton.EnableWindow(that->here == END);
		that->decompressButton.EnableWindow(that->here == END);
	}
	if (that->here == TERM) return true;//exit don't do anything
	if (that->here != END && that->here != START) {
		AfxBeginThread(BackThread, that);
	}
	return false;//OK
}