ReactOS 0.4.15-dev-8241-g63935f8
powercfg.h File Reference
#include <stdarg.h>
#include <ntstatus.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 "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.

Classes

struct  APPLET
 

Macros

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

Typedefs

typedef struct APPLETPAPPLET
 

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)
 

Variables

HINSTANCE hApplet
 
GLOBAL_POWER_POLICY gGPP
 

Macro Definition Documentation

◆ _INC_WINDOWS

#define _INC_WINDOWS

Definition at line 6 of file powercfg.h.

◆ COM_NO_WINDOWS_H

#define COM_NO_WINDOWS_H

Definition at line 7 of file powercfg.h.

◆ MAX_POWER_PAGES

#define MAX_POWER_PAGES   32

Definition at line 35 of file powercfg.h.

◆ WIN32_NO_STATUS

#define WIN32_NO_STATUS

Definition at line 10 of file powercfg.h.

Typedef Documentation

◆ PAPPLET

typedef struct APPLET * PAPPLET

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:2078
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:1621
#define DWLP_USER
Definition: winuser.h:872
#define WM_HSCROLL
Definition: winuser.h:1743
#define IDCANCEL
Definition: winuser.h:831
#define WM_COMMAND
Definition: winuser.h:1740
#define WM_INITDIALOG
Definition: winuser.h:1739
#define IDOK
Definition: winuser.h:830
int WINAPI GetDlgCtrlID(_In_ HWND)
#define WM_DESTROY
Definition: winuser.h:1609
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)

◆ AlarmsDlgProc()

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

Definition at line 167 of file alarms.c.

171{
174
175 switch (uMsg)
176 {
177 case WM_INITDIALOG:
178 if (!Ala_InitData(hwndDlg))
179 {
180 // TODO:
181 // Handle initialization error
182 }
183 return TRUE;
184
185 default:
186 break;
187 }
188
189 return FALSE;
190}
static BOOLEAN Ala_InitData(HWND hwndDlg)
Definition: alarms.c:15
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317

Referenced by Applet1().

◆ HibernateDlgProc()

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

Definition at line 90 of file hibernate.c.

94{
95 switch (uMsg)
96 {
97 case WM_INITDIALOG:
98 Hib_InitDialog(hwndDlg);
99 return TRUE;
100
101 case WM_COMMAND:
102 switch (LOWORD(wParam))
103 {
105 if (HIWORD(wParam) == BN_CLICKED)
106 {
107 PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
108 }
109 break;
110 }
111 break;
112
113 case WM_NOTIFY:
114 if (((LPNMHDR)lParam)->code == (UINT)PSN_APPLY)
115 {
116 return Hib_SaveData(hwndDlg);
117 }
118 break;
119 }
120
121 return FALSE;
122}
#define IDC_HIBERNATEFILE
Definition: resource.h:105
INT_PTR Hib_SaveData(HWND hwndDlg)
Definition: hibernate.c:73
static VOID Hib_InitDialog(HWND hwndDlg)
Definition: hibernate.c:15
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:1925

Referenced by Applet1().

◆ PowerSchemesDlgProc()

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

Definition at line 825 of file powershemes.c.

830{
831 PPOWER_SCHEMES_PAGE_DATA pPageData;
832
834
835 switch (uMsg)
836 {
837 case WM_INITDIALOG:
841 SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pPageData);
842
843 BuildSchemesList(pPageData);
844
845 if (!Pos_InitData(hwndDlg))
846 {
847 // TODO:
848 // Initialization failed
849 // Handle error
850 MessageBox(hwndDlg,_T("Pos_InitData failed\n"), NULL, MB_OK);
851 }
852
853 if (!CreateEnergyList(hwndDlg, pPageData))
854 {
855 // TODO:
856 // Initialization failed
857 // Handle error
858 MessageBox(hwndDlg,_T("CreateEnergyList failed\n"), NULL, MB_OK);
859 }
860 return TRUE;
861
862 case WM_DESTROY:
863 if (pPageData)
864 {
865 DestroySchemesList(pPageData);
866 HeapFree(GetProcessHeap(), 0, pPageData);
868 }
869 break;
870
871 case WM_COMMAND:
872 switch(LOWORD(wParam))
873 {
874 case IDC_ENERGYLIST:
876 {
877 LoadConfig(hwndDlg, pPageData, NULL);
878 PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
879 }
880 break;
881
882 case IDC_DELETE_BTN:
883 DelScheme(hwndDlg, pPageData);
884 break;
885
886 case IDC_SAVEAS_BTN:
887 SaveScheme(hwndDlg, pPageData);
888 break;
889
892 case IDC_DISKACLIST:
893 case IDC_DISKDCLIST:
899 {
900 PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
901 }
902 break;
903 }
904 break;
905
906 case WM_NOTIFY:
907 switch (((LPNMHDR)lParam)->code)
908 {
909 case PSN_APPLY:
910 Pos_SaveData(hwndDlg, pPageData);
911 return TRUE;
912
913 case PSN_SETACTIVE:
914 Pos_InitData(hwndDlg);
915 return TRUE;
916 }
917 break;
918 }
919
920 return FALSE;
921}
#define IDC_SAVEAS_BTN
Definition: resource.h:66
#define IDC_DELETE_BTN
Definition: resource.h:67
#define IDC_MONITORDCLIST
Definition: resource.h:69
#define IDC_STANDBYACLIST
Definition: resource.h:66
#define IDC_MONITORACLIST
Definition: resource.h:68
#define IDC_ENERGYLIST
Definition: resource.h:59
#define IDC_DISKDCLIST
Definition: resource.h:71
#define IDC_HIBERNATEACLIST
Definition: resource.h:73
#define IDC_DISKACLIST
Definition: resource.h:70
#define IDC_STANDBYDCLIST
Definition: resource.h:67
#define IDC_HIBERNATEDCLIST
Definition: resource.h:74
static VOID Pos_SaveData(HWND hwndDlg, PPOWER_SCHEMES_PAGE_DATA pPageData)
Definition: powershemes.c:430
static BOOL CreateEnergyList(HWND hwndDlg, PPOWER_SCHEMES_PAGE_DATA pPageData)
Definition: powershemes.c:738
BOOLEAN Pos_InitData(HWND hwndDlg)
Definition: powershemes.c:205
static VOID LoadConfig(HWND hwndDlg, PPOWER_SCHEMES_PAGE_DATA pPageData, PPOWER_SCHEME pScheme)
Definition: powershemes.c:237
static BOOL DelScheme(HWND hwnd, PPOWER_SCHEMES_PAGE_DATA pPageData)
Definition: powershemes.c:529
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:172
static VOID DestroySchemesList(PPOWER_SCHEMES_PAGE_DATA pPageData)
Definition: powershemes.c:183
static VOID SaveScheme(HWND hwndDlg, PPOWER_SCHEMES_PAGE_DATA pPageData)
Definition: powershemes.c:674
#define PSN_SETACTIVE
Definition: prsht.h:115
#define _T(x)
Definition: vfdio.h:22
#define CBN_SELCHANGE
Definition: winuser.h:1979
#define MB_OK
Definition: winuser.h:790
#define MessageBox
Definition: winuser.h:5831

Referenced by Applet1().

Variable Documentation

◆ gGPP

◆ hApplet

HINSTANCE hApplet
extern

Definition at line 17 of file access.c.