Add flashing effect to "STOP"
This commit is contained in:
parent
8882894f09
commit
862f7fd8e7
@ -31,6 +31,7 @@ namespace watchfuleye {
|
|||||||
, m_overTime(false)
|
, m_overTime(false)
|
||||||
, m_maxMinutes(maximumMinutes)
|
, m_maxMinutes(maximumMinutes)
|
||||||
, m_drive(driveToDetect)
|
, m_drive(driveToDetect)
|
||||||
|
, m_paintCounter(0)
|
||||||
, m_startTime()
|
, m_startTime()
|
||||||
, m_taskbarCreatedMessage(-1)
|
, m_taskbarCreatedMessage(-1)
|
||||||
, m_region(nullptr)
|
, m_region(nullptr)
|
||||||
@ -276,9 +277,12 @@ namespace watchfuleye {
|
|||||||
else { // Over time (red)
|
else { // Over time (red)
|
||||||
SelectObject(app->m_offscreenDC, app->m_lowerFont);
|
SelectObject(app->m_offscreenDC, app->m_lowerFont);
|
||||||
DrawText(app->m_offscreenDC, "Please Eject Your USB", -1, &lowerRect, DT_SINGLELINE | DT_NOCLIP | DT_CENTER | DT_VCENTER);
|
DrawText(app->m_offscreenDC, "Please Eject Your USB", -1, &lowerRect, DT_SINGLELINE | DT_NOCLIP | DT_CENTER | DT_VCENTER);
|
||||||
|
|
||||||
|
if (app->m_paintCounter % 5 > 1) {
|
||||||
SelectObject(app->m_offscreenDC, app->m_timeFont);
|
SelectObject(app->m_offscreenDC, app->m_timeFont);
|
||||||
DrawText(app->m_offscreenDC, "STOP", -1, &timeRect, DT_SINGLELINE | DT_NOCLIP | DT_CENTER | DT_VCENTER);
|
DrawText(app->m_offscreenDC, "STOP", -1, &timeRect, DT_SINGLELINE | DT_NOCLIP | DT_CENTER | DT_VCENTER);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (remaining <= 0)
|
if (remaining <= 0)
|
||||||
app->m_overTime = true;
|
app->m_overTime = true;
|
||||||
@ -288,6 +292,7 @@ namespace watchfuleye {
|
|||||||
SelectObject(app->m_offscreenDC, prevBitmap);
|
SelectObject(app->m_offscreenDC, prevBitmap);
|
||||||
|
|
||||||
EndPaint(hWnd, &ps);
|
EndPaint(hWnd, &ps);
|
||||||
|
app->m_paintCounter++;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -23,6 +23,7 @@ namespace watchfuleye {
|
|||||||
void queryThreadFunction();
|
void queryThreadFunction();
|
||||||
|
|
||||||
std::string m_appName, m_appVersion;
|
std::string m_appName, m_appVersion;
|
||||||
|
|
||||||
HWND m_window;
|
HWND m_window;
|
||||||
|
|
||||||
bool m_running; // Is the application running?
|
bool m_running; // Is the application running?
|
||||||
@ -32,6 +33,8 @@ namespace watchfuleye {
|
|||||||
unsigned int m_maxMinutes;
|
unsigned int m_maxMinutes;
|
||||||
const char* m_drive;
|
const char* m_drive;
|
||||||
|
|
||||||
|
uint8_t m_paintCounter;
|
||||||
|
|
||||||
TimePoint m_startTime;
|
TimePoint m_startTime;
|
||||||
|
|
||||||
UINT m_taskbarCreatedMessage;
|
UINT m_taskbarCreatedMessage;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user