![]() |
BatteryMonitor
|
Root namespace. More...
Functions | |
void | addNotifyIcon (HWND hwnd) |
Adds an icon to the taskbar. | |
void | cleanUp (HWND hwnd) |
Memory and handler cleanups, taskbar icon removal. | |
void | errOut (void) |
Error output. | |
BATTERY_INFORMATION | getBatteryInformation () |
retrieves battery informations from the system. | |
void | initDevice (void) |
Retrieves the path of the battery device. | |
HWND | setupWindow (int nCmdShow) |
Shows the main window. | |
long | setupWindowClass (void) |
registers the window class stored in classname. | |
void | showBatteryInfo (HWND hwnd) |
Shows a balloon tip with battery information. | |
void | shutdown (void) |
Tries to shut down the computer. | |
LRESULT CALLBACK | wndProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) |
The window procedure. | |
Variables | |
double | battery = 0 |
Battery charge. | |
long | batterylifetime = -1 |
Remaining battery lifetime in seconds. | |
HBRUSH | blue |
Blue brush. | |
char | classname [14] |
Name of registered window class. | |
char * | devicepath |
Path to battery device. | |
HBRUSH | green |
Green brush. | |
HINSTANCE | instance |
Application instance. | |
HBRUSH | red |
Red brush. | |
bool | shutdown_enabled = false |
Indicates, if shutdown was invoked by BatteryMonitor. | |
UINT | WM_TASKBARCREATED = 0 |
Window message for taskbarcreated-event. | |
HBRUSH | yellow |
Yellow brush. |
Root namespace.
void BatteryMonitor::addNotifyIcon | ( | HWND | hwnd | ) |
void BatteryMonitor::cleanUp | ( | HWND | hwnd | ) |
void BatteryMonitor::errOut | ( | void | ) |
Error output.
If BatteryMonitor is compiled in debug configuration (with a DEBUG defined) , a messagebox containing the error text is shown.
BATTERY_INFORMATION BatteryMonitor::getBatteryInformation | ( | ) |
void BatteryMonitor::initDevice | ( | void | ) |
Retrieves the path of the battery device.
This function retrieves the path of the battery device and stores it into devicepath.
HWND BatteryMonitor::setupWindow | ( | int | nCmdShow | ) |
Shows the main window.
This funktion creates a window of the class stored in classname. This window is automatically set click-through, transparent and topmost.
[in] | nCmdShow | Can override the default visibility-parameters |
long BatteryMonitor::setupWindowClass | ( | void | ) |
void BatteryMonitor::shutdown | ( | void | ) |
Tries to shut down the computer.
This function is called if remaining battery lifetime is less than 5 minutes.
LRESULT CALLBACK BatteryMonitor::wndProc | ( | HWND | hwnd, |
UINT | msg, | ||
WPARAM | wParam, | ||
LPARAM | lParam | ||
) |
double BatteryMonitor::battery = 0 |
long BatteryMonitor::batterylifetime = -1 |
char BatteryMonitor::classname[14] |
HINSTANCE BatteryMonitor::instance |
UINT BatteryMonitor::WM_TASKBARCREATED = 0 |