BatteryMonitor
Main Page
Namespaces
Files
File List
File Members
/media/development/cpp/BatteryMonitor/main.h
Go to the documentation of this file.
1
8
#ifndef _MAIN_H
9
#define _MAIN_H
10
11
14
#define WINVER 0x0501
15
19
#define _WIN32_IE 0x600
20
#include <initguid.h>
21
#include <stdlib.h>
22
#include <windows.h>
23
#include <winuser.h>
24
#include <stdio.h>
25
#include <setupapi.h>
26
#include <ddk/batclass.h>
27
#include "
mainres.h
"
28
31
namespace
BatteryMonitor
{
32
38
LRESULT CALLBACK
wndProc
(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
39
46
void
addNotifyIcon
(HWND hwnd);
47
53
void
errOut
(
void
);
54
57
void
showBatteryInfo
(HWND hwnd);
58
64
void
shutdown
(
void
);
65
71
void
initDevice
(
void
);
72
81
HWND
setupWindow
(
int
nCmdShow);
82
87
long
setupWindowClass
(
void
);
88
93
void
cleanUp
(HWND hwnd);
94
102
BATTERY_INFORMATION
getBatteryInformation
() ;
103
104
107
#define UPDATE_BATTERY 1
108
115
char
*
devicepath
;
116
129
HBRUSH
red
,
yellow
,
blue
,
green
;
130
134
HINSTANCE
instance
;
135
142
double
battery
=0;
143
148
long
batterylifetime
=-1;
149
154
char
classname
[14];
155
162
UINT
WM_TASKBARCREATED
=0;
163
166
bool
shutdown_enabled
=
false
;
167
168
}
169
#endif
/* _MAIN_H */
170
BatteryMonitor::WM_TASKBARCREATED
UINT WM_TASKBARCREATED
Window message for taskbarcreated-event.
Definition:
main.h:162
BatteryMonitor::getBatteryInformation
BATTERY_INFORMATION getBatteryInformation()
retrieves battery informations from the system.
Definition:
main.cpp:328
BatteryMonitor::cleanUp
void cleanUp(HWND hwnd)
Memory and handler cleanups, taskbar icon removal.
Definition:
main.cpp:92
BatteryMonitor
Root namespace.
Definition:
main.cpp:65
BatteryMonitor::yellow
HBRUSH yellow
Yellow brush.
Definition:
main.h:129
BatteryMonitor::initDevice
void initDevice()
Retrieves the path of the battery device.
Definition:
main.cpp:301
BatteryMonitor::addNotifyIcon
void addNotifyIcon(HWND hwnd)
Adds an icon to the taskbar.
Definition:
main.cpp:234
BatteryMonitor::errOut
void errOut()
Error output.
Definition:
main.cpp:123
BatteryMonitor::blue
HBRUSH blue
Blue brush.
Definition:
main.h:129
BatteryMonitor::green
HBRUSH green
Green brush.
Definition:
main.h:129
BatteryMonitor::battery
double battery
Battery charge.
Definition:
main.h:142
BatteryMonitor::shutdown_enabled
bool shutdown_enabled
Indicates, if shutdown was invoked by BatteryMonitor.
Definition:
main.h:166
BatteryMonitor::batterylifetime
long batterylifetime
Remaining battery lifetime in seconds.
Definition:
main.h:148
BatteryMonitor::instance
HINSTANCE instance
Application instance.
Definition:
main.h:134
mainres.h
Resources of BatteryMonitor.
BatteryMonitor::devicepath
char * devicepath
Path to battery device.
Definition:
main.h:115
BatteryMonitor::showBatteryInfo
void showBatteryInfo(HWND hwnd)
Shows a balloon tip with battery information.
Definition:
main.cpp:249
BatteryMonitor::setupWindowClass
long setupWindowClass()
registers the window class stored in classname.
Definition:
main.cpp:105
BatteryMonitor::setupWindow
HWND setupWindow(int nCmdShow)
Shows the main window.
Definition:
main.cpp:66
BatteryMonitor::wndProc
LRESULT CALLBACK wndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
The window procedure.
Definition:
main.cpp:133
BatteryMonitor::classname
char classname[14]
Name of registered window class.
Definition:
main.h:154
BatteryMonitor::shutdown
void shutdown()
Tries to shut down the computer.
Definition:
main.cpp:273
BatteryMonitor::red
HBRUSH red
Red brush.
Definition:
main.h:129
main.h
Generated on Thu May 17 2018 15:42:03 for BatteryMonitor by
1.8.11