55 else if (
p > 12 &&
p <= 37)
57 else if (
p > 37 &&
p <= 62)
59 else if (
p > 62 &&
p <= 87)
123 TRACE(
"Power_Init\n");
131 TRACE(
"Power_Update\n");
139 TRACE(
"Power_Shutdown\n");
190 if (PowerSchemeContext->
uiFirst == 0)
191 PowerSchemeContext->
uiFirst = uiIndex + 1;
193 PowerSchemeContext->
uiLast = uiIndex + 1;
215 PowerSchemeContext.
uiLast,
243 TRACE(
"Power_Message: WM_USER+220\n");
260 TRACE(
"Power_Message: WM_USER+221\n");
309 TRACE(
"Power_Message received for unknown ID %d, ignoring.\n");
#define STDMETHODCALLTYPE
void __cdecl Format(UINT nFormatID,...)
struct _PWRSCHEMECONTEXT * PPWRSCHEMECONTEXT
HRESULT STDMETHODCALLTYPE Power_Message(_In_ CSysTray *pSysTray, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT &lResult)
static UINT Quantize(BYTE p)
struct _PWRSCHEMECONTEXT PWRSCHEMECONTEXT
static HICON g_hIconBattery
HRESULT STDMETHODCALLTYPE Power_Init(_In_ CSysTray *pSysTray)
HRESULT STDMETHODCALLTYPE Power_Shutdown(_In_ CSysTray *pSysTray)
HRESULT STDMETHODCALLTYPE Power_Update(_In_ CSysTray *pSysTray)
static HICON DynamicLoadIcon(HINSTANCE hinst)
static void _ShowContextMenu(CSysTray *pSysTray)
static VOID ShowPowerSchemesPopupMenu(CSysTray *pSysTray)
static BOOLEAN CALLBACK PowerSchemesEnumProc(UINT uiIndex, DWORD dwName, LPWSTR sName, DWORD dwDesc, LPWSTR sDesc, PPOWER_POLICY pp, LPARAM lParam)
#define POWER_SERVICE_FLAG
#define IDS_PWR_PERCENT_REMAINING
#define IDS_PWR_UNKNOWN_REMAINING
#define IDS_PWR_PROPERTIES
BOOL WINAPI GetSystemPowerStatus(IN LPSYSTEM_POWER_STATUS PowerStatus)
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
BOOLEAN WINAPI GetActivePwrScheme(PUINT puiID)
BOOLEAN WINAPI SetActivePwrScheme(UINT uiID, PGLOBAL_POWER_POLICY lpGlobalPowerPolicy, PPOWER_POLICY lpPowerPolicy)
BOOLEAN WINAPI EnumPwrSchemes(PWRSCHEMESENUMPROC lpfnPwrSchemesEnumProc, LPARAM lParam)
HINSTANCE WINAPI ShellExecuteW(HWND hwnd, LPCWSTR lpVerb, LPCWSTR lpFile, LPCWSTR lpParameters, LPCWSTR lpDirectory, INT nShowCmd)
#define BATTERY_FLAG_CHARGING
#define BATTERY_FLAG_NO_BATTERY
#define BATTERY_FLAG_UNKNOWN
#define BATTERY_PERCENTAGE_UNKNOWN
HMENU WINAPI CreatePopupMenu(void)
BOOL WINAPI SetMenuDefaultItem(_In_ HMENU, _In_ UINT, _In_ UINT)
BOOL WINAPI SetForegroundWindow(_In_ HWND)
BOOL WINAPI GetCursorPos(_Out_ LPPOINT)
BOOL WINAPI TrackPopupMenuEx(_In_ HMENU, _In_ UINT, _In_ int, _In_ int, _In_ HWND, _In_opt_ LPTPMPARAMS)
UINT WINAPI GetDoubleClickTime(void)
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
BOOL WINAPI CheckMenuRadioItem(_In_ HMENU, _In_ UINT, _In_ UINT, _In_ UINT, _In_ UINT)
BOOL WINAPI DestroyMenu(_In_ HMENU)
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)
BOOL WINAPI AppendMenuW(_In_ HMENU, _In_ UINT, _In_ UINT_PTR, _In_opt_ LPCWSTR)