watchful-eye/WatchfulEye/src/Application.h
Grayson Riffe 1763bf72da
Replace dialog with regular window + other stuff
No caption anymore
Can drag the window from anywhere
Drag cursor
Rounded corners
Prevent DPI resizing
Ready text
2026-06-07 20:29:31 -05:00

43 lines
1.2 KiB
C++

// Application class header
namespace watchfuleye {
class Application {
using Clock = std::chrono::high_resolution_clock;
using TimePoint = std::chrono::time_point<Clock>;
using Duration = std::chrono::duration<double, std::ratio<1, 1>>;
using Seconds = int;
public:
Application(const char* appName, const char* appVersion, unsigned int maximumMinutes, const char* driveToDetect);
void run();
~Application();
private:
static LRESULT CALLBACK wndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
void sizeWindow(const HWND& hWnd);
void createTrayIcon();
void queryThreadFunction();
std::string m_appName, m_appVersion;
HWND m_window;
bool m_running; // Is the application running?
bool m_active; // Is the timer ticking?
bool m_overTime; // Are we out of time?
unsigned int m_maxMinutes;
const char* m_drive;
TimePoint m_startTime;
UINT m_taskbarCreatedMessage;
HRGN m_region;
HFONT m_timeFont, m_lowerFont;
HBRUSH m_greenBrush, m_yellowBrush, m_redBrush;
};
}