int QueryUserStop(void) { int control, result; static int Initialized = FALSE; PushHelpIndex(USER_STOP_INDEX); if (!Initialized) { Initialize(); Initialized = TRUE; } SetStatusBar(RED, WHITE, " "); SetStatusBar(RED, WHITE, " Defragmentation process stopped."); OpenWindow(&QueryBox); control = ControlWindow(&QueryBox); CloseWindow(); /* Interpret values. */ if (control == YESBUTTON) result = TRUE; else result = FALSE; PopHelpIndex(); return result; }
char ShowDriveSelectionBox(void) { int control, i, len, index = 0; char drive; static int Initialized = FALSE; PushHelpIndex(SELECT_DRIVE_INDEX); if (!Initialized) { Initialized = TRUE; Initialize(); } drive = GetOptimizationDrive(); len = strlen(DrvBuffer); for (i = 0; i < len; i++) { if (drive == DrvBuffer[i]) { index = i; break; } } if (index) if (index - LBox.top < SELBOX_HEIGHT - 2) LBox.CursorPos = index - LBox.top; else { LBox.CursorPos = SELBOX_HEIGHT - 2; LBox.top = index - (SELBOX_HEIGHT - 2); } else { LBox.CursorPos = 0; LBox.top = 0; } OpenWindow(&DriveBox); control = ControlWindow(&DriveBox); CloseWindow(); PopHelpIndex(); if ((control == OKBUTTON) || (control == DRIVEBOX)) return DrvBuffer[LBox.top+LBox.CursorPos]; return 0; }