diff --git a/WatchfulEye/src/Application.cpp b/WatchfulEye/src/Application.cpp index d4118b9..f20b0c7 100644 --- a/WatchfulEye/src/Application.cpp +++ b/WatchfulEye/src/Application.cpp @@ -31,6 +31,7 @@ namespace watchfuleye { , m_overTime(false) , m_maxMinutes(maximumMinutes) , m_drive(driveToDetect) + , m_paintCounter(0) , m_startTime() , m_taskbarCreatedMessage(-1) , m_region(nullptr) @@ -276,8 +277,11 @@ namespace watchfuleye { else { // Over time (red) 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); - SelectObject(app->m_offscreenDC, app->m_timeFont); - DrawText(app->m_offscreenDC, "STOP", -1, &timeRect, DT_SINGLELINE | DT_NOCLIP | DT_CENTER | DT_VCENTER); + + if (app->m_paintCounter % 5 > 1) { + SelectObject(app->m_offscreenDC, app->m_timeFont); + DrawText(app->m_offscreenDC, "STOP", -1, &timeRect, DT_SINGLELINE | DT_NOCLIP | DT_CENTER | DT_VCENTER); + } } if (remaining <= 0) @@ -288,6 +292,7 @@ namespace watchfuleye { SelectObject(app->m_offscreenDC, prevBitmap); EndPaint(hWnd, &ps); + app->m_paintCounter++; return 0; } diff --git a/WatchfulEye/src/Application.h b/WatchfulEye/src/Application.h index 1d5750e..815bf03 100644 --- a/WatchfulEye/src/Application.h +++ b/WatchfulEye/src/Application.h @@ -23,6 +23,7 @@ namespace watchfuleye { void queryThreadFunction(); std::string m_appName, m_appVersion; + HWND m_window; bool m_running; // Is the application running? @@ -32,6 +33,8 @@ namespace watchfuleye { unsigned int m_maxMinutes; const char* m_drive; + uint8_t m_paintCounter; + TimePoint m_startTime; UINT m_taskbarCreatedMessage;