ReactOS 0.4.16-dev-1948-gd260c1d
powercfg.h File Reference
#include <stdarg.h>
#include <ntstatus.h>
#include <windows.h>
#include <windef.h>
#include <winbase.h>
#include <winreg.h>
#include <cpl.h>
#include <tchar.h>
#include <shlobj.h>
#include <shlwapi.h>
#include <powrprof.h>
#include <ndk/rtlfuncs.h>
#include <strsafe.h>
#include <setupapi.h>
#include <batclass.h>
#include <initguid.h>
#include <devguid.h>
#include "resource.h"
Include dependency graph for powercfg.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define _INC_WINDOWS
 
#define COM_NO_WINDOWS_H
 
#define WIN32_NO_STATUS
 
#define MAX_POWER_PAGES   32
 

Functions

INT_PTR CALLBACK PowerSchemesDlgProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
INT_PTR CALLBACK AlarmsDlgProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
INT_PTR CALLBACK AdvancedDlgProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
INT_PTR CALLBACK HibernateDlgProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
INT_PTR CALLBACK PowerMeterDlgProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 

Variables

HINSTANCE hApplet
 
GLOBAL_POWER_POLICY gGPP
 

Macro Definition Documentation

◆ _INC_WINDOWS

#define _INC_WINDOWS

Definition at line 15 of file powercfg.h.

◆ COM_NO_WINDOWS_H

#define COM_NO_WINDOWS_H

Definition at line 16 of file powercfg.h.

◆ MAX_POWER_PAGES

#define MAX_POWER_PAGES   32

Definition at line 41 of file powercfg.h.

◆ WIN32_NO_STATUS

#define WIN32_NO_STATUS

Definition at line 19 of file powercfg.h.

Function Documentation

◆ AdvancedDlgProc()

INT_PTR CALLBACK AdvancedDlgProc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 225 of file advanced.c.

230{
232
234
235 switch (uMsg)
236 {
237 case WM_INITDIALOG:
239 if (pData != NULL)
240 {
242 pData->Context = (PADVANCED_CONTEXT)((LONG_PTR)lParam);
243 OnInitDialog(hwndDlg, pData);
244 }
245 return TRUE;
246
247 case WM_COMMAND:
248 switch (LOWORD(wParam))
249 {
250 case IDOK:
251 EndDialog(hwndDlg, IDOK);
252 break;
253 }
254 break;
255
256 case WM_HSCROLL:
257 if (pData != NULL)
258 {
261 }
262 break;
263
264 case WM_CLOSE:
265 EndDialog(hwndDlg, IDCANCEL);
266 break;
267
268 case WM_DESTROY:
269 if (pData != NULL)
270 {
273 }
274 break;
275 }
276
277 return FALSE;
278}
struct _ADVANCED_DATA * PADVANCED_DATA
static VOID OnHScroll(HWND hwndDlg, PADVANCED_DATA pData, DWORD dwCtrlID)
Definition: advanced.c:182
static VOID OnInitDialog(HWND hwndDlg, PADVANCED_DATA pData)
Definition: advanced.c:25
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define HeapFree(x, y, z)
Definition: compat.h:735
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define LOWORD(l)
Definition: pedump.c:82
#define TB_THUMBTRACK
Definition: commctrl.h:2083
struct _ADVANCED_CONTEXT * PADVANCED_CONTEXT
#define GetWindowLongPtr
Definition: treelist.c:73
#define SetWindowLongPtr
Definition: treelist.c:70
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
Definition: twain.h:1830
#define WM_CLOSE
Definition: winuser.h:1649
#define DWLP_USER
Definition: winuser.h:883
#define WM_HSCROLL
Definition: winuser.h:1771
#define IDCANCEL
Definition: winuser.h:842
#define WM_COMMAND
Definition: winuser.h:1768
#define WM_INITDIALOG
Definition: winuser.h:1767
#define IDOK
Definition: winuser.h:841
int WINAPI GetDlgCtrlID(_In_ HWND)
#define WM_DESTROY
Definition: winuser.h:1637
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)

◆ AlarmsDlgProc()

INT_PTR CALLBACK AlarmsDlgProc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 151 of file alarms.c.

155{
158
159 switch (uMsg)
160 {
161 case WM_INITDIALOG:
162 if (!Ala_InitData(hwndDlg))
163 {
164 // TODO:
165 // Handle initialization error
166 }
167 return TRUE;
168
169 default:
170 break;
171 }
172
173 return FALSE;
174}
static BOOLEAN Ala_InitData(HWND hwndDlg)
Definition: alarms.c:13
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:329

Referenced by Applet().

◆ HibernateDlgProc()

INT_PTR CALLBACK HibernateDlgProc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 87 of file hibernate.c.

91{
92 switch (uMsg)
93 {
94 case WM_INITDIALOG:
95 Hib_InitDialog(hwndDlg);
96 return TRUE;
97
98 case WM_COMMAND:
99 switch (LOWORD(wParam))
100 {
102 if (HIWORD(wParam) == BN_CLICKED)
103 PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
104 break;
105 }
106 break;
107
108 case WM_NOTIFY:
109 if (((LPNMHDR)lParam)->code == (UINT)PSN_APPLY)
110 return Hib_SaveData(hwndDlg);
111 break;
112 }
113
114 return FALSE;
115}
#define IDC_HIBERNATEFILE
Definition: resource.h:148
INT_PTR Hib_SaveData(HWND hwndDlg)
Definition: hibernate.c:71
static VOID Hib_InitDialog(HWND hwndDlg)
Definition: hibernate.c:13
unsigned int UINT
Definition: ndis.h:50
#define PropSheet_Changed(d, w)
Definition: prsht.h:344
#define PSN_APPLY
Definition: prsht.h:117
#define WM_NOTIFY
Definition: richedit.h:61
Definition: inflate.c:139
#define HIWORD(l)
Definition: typedefs.h:247
HWND WINAPI GetParent(_In_ HWND)
#define BN_CLICKED
Definition: winuser.h:1954

Referenced by Applet().

◆ PowerMeterDlgProc()

INT_PTR CALLBACK PowerMeterDlgProc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 481 of file powermeter.c.

482{
483 switch (uMsg)
484 {
485 case WM_INITDIALOG:
486 PowerMeter_InitDialog(hwndDlg);
487 return TRUE;
488
489 case WM_COMMAND:
491 {
492 PowerMeter_InitDialog(hwndDlg);
493 break;
494 }
496 {
499 {
502 (PVOID)hwndDlg,
503 0, NULL);
504 if (Thread)
506 }
507 else
508 {
509 /* Activate the existing window */
512 }
513 }
514 break;
515 }
516 return FALSE;
517}
#define IDC_SHOWDETAILS
Definition: resource.h:164
#define IDI_BATTERYDETAIL0
Definition: resource.h:180
#define IDI_BATTERYDETAIL7
Definition: resource.h:187
#define CloseHandle
Definition: compat.h:739
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
Definition: thread.c:137
_In_opt_ PFILE_OBJECT _In_opt_ PETHREAD Thread
Definition: fltkernel.h:2653
static DWORD WINAPI PowerMeterDetailDlgThread(PVOID pParam)
Definition: powermeter.c:346
static UINT SelectedBattery
ID of battery currently shown in the details dialog.
Definition: powermeter.c:12
static HWND hwndDlgDetail
Single modeless battery details dialog.
Definition: powermeter.c:13
static VOID PowerMeter_InitDialog(HWND hwndDlg)
Definition: powermeter.c:385
VOID WINAPI SwitchToThisWindow(HWND hwnd, BOOL fAltTab)
Definition: window.c:82
BOOL WINAPI IsWindow(_In_opt_ HWND)
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define SW_SHOWNA
Definition: winuser.h:789

Referenced by Applet().

◆ PowerSchemesDlgProc()

INT_PTR CALLBACK PowerSchemesDlgProc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 826 of file powershemes.c.

831{
832 PPOWER_SCHEMES_PAGE_DATA pPageData;
833
835
836 switch (uMsg)
837 {
838 case WM_INITDIALOG:
842 SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pPageData);
843
844 BuildSchemesList(pPageData);
845
846 if (!Pos_InitData(hwndDlg))
847 {
848 // TODO:
849 // Initialization failed
850 // Handle error
851 MessageBox(hwndDlg,_T("Pos_InitData failed\n"), NULL, MB_OK);
852 }
853
854 if (!CreateEnergyList(hwndDlg, pPageData))
855 {
856 // TODO:
857 // Initialization failed
858 // Handle error
859 MessageBox(hwndDlg,_T("CreateEnergyList failed\n"), NULL, MB_OK);
860 }
861 return TRUE;
862
863 case WM_DESTROY:
864 if (pPageData)
865 {
866 DestroySchemesList(pPageData);
867 HeapFree(GetProcessHeap(), 0, pPageData);
869 }
870 break;
871
872 case WM_COMMAND:
873 switch(LOWORD(wParam))
874 {
875 case IDC_ENERGYLIST:
877 {
878 LoadConfig(hwndDlg, pPageData, NULL);
879 PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
880 }
881 break;
882
883 case IDC_DELETE_BTN:
884 DelScheme(hwndDlg, pPageData);
885 break;
886
887 case IDC_SAVEAS_BTN:
888 SaveScheme(hwndDlg, pPageData);
889 break;
890
893 case IDC_DISKACLIST:
894 case IDC_DISKDCLIST:
900 {
901 PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
902 }
903 break;
904 }
905 break;
906
907 case WM_NOTIFY:
908 switch (((LPNMHDR)lParam)->code)
909 {
910 case PSN_APPLY:
911 Pos_SaveData(hwndDlg, pPageData);
912 return TRUE;
913
914 case PSN_SETACTIVE:
915 Pos_InitData(hwndDlg);
916 return TRUE;
917 }
918 break;
919 }
920
921 return FALSE;
922}
#define IDC_SAVEAS_BTN
Definition: resource.h:66
#define IDC_DELETE_BTN
Definition: resource.h:67
#define IDC_MONITORDCLIST
Definition: resource.h:112
#define IDC_STANDBYACLIST
Definition: resource.h:109
#define IDC_MONITORACLIST
Definition: resource.h:111
#define IDC_ENERGYLIST
Definition: resource.h:102
#define IDC_DISKDCLIST
Definition: resource.h:114
#define IDC_HIBERNATEACLIST
Definition: resource.h:116
#define IDC_DISKACLIST
Definition: resource.h:113
#define IDC_STANDBYDCLIST
Definition: resource.h:110
#define IDC_HIBERNATEDCLIST
Definition: resource.h:117
static VOID Pos_SaveData(HWND hwndDlg, PPOWER_SCHEMES_PAGE_DATA pPageData)
Definition: powershemes.c:431
static BOOL CreateEnergyList(HWND hwndDlg, PPOWER_SCHEMES_PAGE_DATA pPageData)
Definition: powershemes.c:739
BOOLEAN Pos_InitData(HWND hwndDlg)
Definition: powershemes.c:204
static VOID LoadConfig(HWND hwndDlg, PPOWER_SCHEMES_PAGE_DATA pPageData, PPOWER_SCHEME pScheme)
Definition: powershemes.c:238
static BOOL DelScheme(HWND hwnd, PPOWER_SCHEMES_PAGE_DATA pPageData)
Definition: powershemes.c:530
struct _POWER_SCHEMES_PAGE_DATA POWER_SCHEMES_PAGE_DATA
struct _POWER_SCHEMES_PAGE_DATA * PPOWER_SCHEMES_PAGE_DATA
static VOID BuildSchemesList(PPOWER_SCHEMES_PAGE_DATA pPageData)
Definition: powershemes.c:171
static VOID DestroySchemesList(PPOWER_SCHEMES_PAGE_DATA pPageData)
Definition: powershemes.c:182
static VOID SaveScheme(HWND hwndDlg, PPOWER_SCHEMES_PAGE_DATA pPageData)
Definition: powershemes.c:675
#define PSN_SETACTIVE
Definition: prsht.h:115
#define _T(x)
Definition: vfdio.h:22
#define CBN_SELCHANGE
Definition: winuser.h:2008
#define MB_OK
Definition: winuser.h:801
#define MessageBox
Definition: winuser.h:5933

Referenced by Applet().

Variable Documentation

◆ gGPP

◆ hApplet

HINSTANCE hApplet
extern

Definition at line 17 of file access.c.