Compare commits

..

No commits in common. "862f7fd8e7fce8baa419b76438d3361e286f64af" and "81b8ceb3d98adaecc1738cc2f0336314253b4e6c" have entirely different histories.

2 changed files with 2 additions and 20 deletions

View File

@ -31,7 +31,6 @@ namespace watchfuleye {
, m_overTime(false)
, m_maxMinutes(maximumMinutes)
, m_drive(driveToDetect)
, m_paintCounter(0)
, m_startTime()
, m_taskbarCreatedMessage(-1)
, m_region(nullptr)
@ -40,7 +39,6 @@ namespace watchfuleye {
, m_greenBrush(nullptr)
, m_yellowBrush(nullptr)
, m_redBrush(nullptr)
, m_outlinePen(nullptr)
, m_offscreenDC(nullptr)
, m_offscreenBitmap(nullptr)
{
@ -118,8 +116,6 @@ namespace watchfuleye {
app->m_yellowBrush = CreateSolidBrush(RGB(255, 255, 150));
app->m_redBrush = CreateSolidBrush(RGB(255, 150, 150));
app->m_outlinePen = CreatePen(PS_SOLID, 5, RGB(0, 0, 0));
// App will update (repaint) at 5 FPS
SendMessage(hWnd, WM_UPDATE, NULL, NULL);
SetTimer(hWnd, IDT_UPDATE, 200, nullptr);
@ -244,12 +240,6 @@ namespace watchfuleye {
FillRect(app->m_offscreenDC, &clientRect, backgroundBrush);
// Draw outline
SelectObject(app->m_offscreenDC, GetStockObject(NULL_BRUSH));
SelectObject(app->m_offscreenDC, app->m_outlinePen);
RoundRect(app->m_offscreenDC, 1, 1, WINDOW_WIDTH - 2, WINDOW_HEIGHT - 2, 20, 20);
// Setup text options
SetTextColor(app->m_offscreenDC, RGB(0, 0, 0));
SetBkMode(app->m_offscreenDC, TRANSPARENT);
@ -277,11 +267,8 @@ 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);
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);
}
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)
@ -292,7 +279,6 @@ namespace watchfuleye {
SelectObject(app->m_offscreenDC, prevBitmap);
EndPaint(hWnd, &ps);
app->m_paintCounter++;
return 0;
}

View File

@ -23,7 +23,6 @@ namespace watchfuleye {
void queryThreadFunction();
std::string m_appName, m_appVersion;
HWND m_window;
bool m_running; // Is the application running?
@ -33,15 +32,12 @@ namespace watchfuleye {
unsigned int m_maxMinutes;
const char* m_drive;
uint8_t m_paintCounter;
TimePoint m_startTime;
UINT m_taskbarCreatedMessage;
HRGN m_region;
HFONT m_timeFont, m_lowerFont;
HBRUSH m_greenBrush, m_yellowBrush, m_redBrush;
HPEN m_outlinePen;
HDC m_offscreenDC;
HBITMAP m_offscreenBitmap;
};