Processing of a game file for reading it, searching positions, saving
selected games or creating a book from them can take minutes. To keep
the application responsive during that time, the main loops of those
tasks calls DoEvents(). A possible risk is that the user can now do
too much, and will initiate actions that interfere with the tast in
progress.
if(lg->position >= 0) { // selected?
LoadGame(f, nItem, "", TRUE);
SaveGamePGN2(g); // leaves g open
- cnt++;
+ cnt++; DoEvents();
}
lg = (ListGame *) lg->node.succ;
}
if(lg->position >= 0) {
LoadGame(f, nItem, "", TRUE);
AddGameToBook(TRUE);
+ DoEvents();
}
lg = (ListGame *) lg->node.succ;
}
}
if(gameNumber % 1000 == 0) {
snprintf(buf, MSG_SIZ, _("Reading game file (%d)"), gameNumber);
- DisplayTitle(buf);
+ DisplayTitle(buf); DoEvents();
}
}
while (cm != (ChessMove) 0);
if(lg->number % 2000 == 0) {
char buf[MSG_SIZ];
snprintf(buf, MSG_SIZ, _("Scanning through games (%d)"), lg->number);
- DisplayTitle(buf);
+ DisplayTitle(buf); DoEvents();
}
lg->position = pos;
lg = (ListGame *) lg->node.succ;
\r
if(nItem % 2000 == 0) {\r
snprintf(buf, MSG_SIZ, _("Scanning through games (%d)"), nItem);\r
- SetWindowText(hwndMain, buf);\r
+ SetWindowText(hwndMain, buf); DoEvents();\r
}\r
\r
if(!narrow || lg->position >= 0) {\r