![]() |
BatteryMonitor
|
Root namespace. More...
Functions | |
| void | addNotifyIcon (HWND hwnd) |
| Adds an icon to the taskbar. More... | |
| void | cleanUp (HWND hwnd) |
| Memory and handler cleanups, taskbar icon removal. More... | |
| void | errOut (void) |
| Error output. More... | |
| BATTERY_INFORMATION | getBatteryInformation () |
| retrieves battery informations from the system. More... | |
| void | initDevice (void) |
| Retrieves the path of the battery device. More... | |
| HWND | setupWindow (int nCmdShow) |
| Shows the main window. More... | |
| long | setupWindowClass (void) |
| registers the window class stored in classname. More... | |
| void | showBatteryInfo (HWND hwnd) |
| Shows a balloon tip with battery information. | |
| void | shutdown (void) |
| Tries to shut down the computer. More... | |
| LRESULT CALLBACK | wndProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) |
| The window procedure. More... | |
Variables | |
| double | battery =0 |
| Battery charge. More... | |
| long | batterylifetime =-1 |
| Remaining battery lifetime in seconds. More... | |
| HBRUSH | blue |
| Blue brush. | |
| char | classname [14] |
| Name of registered window class. More... | |
| char * | devicepath |
| Path to battery device. More... | |
| HBRUSH | green |
| Green brush. | |
| HINSTANCE | instance |
| Application instance. More... | |
| HBRUSH | red |
| Red brush. | |
| bool | shutdown_enabled =false |
| Indicates, if shutdown was invoked by BatteryMonitor. | |
| UINT | WM_TASKBARCREATED =0 |
| Window message for taskbarcreated-event. More... | |
| 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] |
| char* BatteryMonitor::devicepath |
| HINSTANCE BatteryMonitor::instance |