ReactOS  0.4.15-dev-1033-gd7d716a
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  {
259  if (LOWORD(wParam) == TB_THUMBTRACK)
260  OnHScroll(hwndDlg, pData, GetDlgCtrlID((HWND)lParam));
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 }
#define TB_THUMBTRACK
Definition: commctrl.h:2074
#define IDOK
Definition: winuser.h:824
#define TRUE
Definition: types.h:120
struct _ADVANCED_CONTEXT * PADVANCED_CONTEXT
#define SetWindowLongPtr
Definition: treelist.c:70
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
WPARAM wParam
Definition: combotst.c:138
int WINAPI GetDlgCtrlID(_In_ HWND)
struct _ADVANCED_DATA * PADVANCED_DATA
#define FALSE
Definition: types.h:117
smooth NULL
Definition: ftsmooth.c:416
#define WM_DESTROY
Definition: winuser.h:1591
#define GetProcessHeap()
Definition: compat.h:484
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define WM_CLOSE
Definition: winuser.h:1603
static VOID OnHScroll(HWND hwndDlg, PADVANCED_DATA pData, DWORD dwCtrlID)
Definition: advanced.c:182
#define DWLP_USER
Definition: winuser.h:866
static VOID OnInitDialog(HWND hwndDlg, PADVANCED_DATA pData)
Definition: advanced.c:25
#define WM_COMMAND
Definition: winuser.h:1722
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define WM_HSCROLL
Definition: winuser.h:1725
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
#define GetWindowLongPtr
Definition: treelist.c:73
#define IDCANCEL
Definition: winuser.h:825
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
Definition: twain.h:1827
#define WM_INITDIALOG
Definition: winuser.h:1721
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
#define HeapFree(x, y, z)
Definition: compat.h:483

◆ 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 }
#define TRUE
Definition: types.h:120
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
static BOOLEAN Ala_InitData(HWND hwndDlg)
Definition: alarms.c:15
WPARAM wParam
Definition: combotst.c:138
#define FALSE
Definition: types.h:117
#define WM_INITDIALOG
Definition: winuser.h:1721
LPARAM lParam
Definition: combotst.c:139

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  {
104  case IDC_HIBERNATEFILE:
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 TRUE
Definition: types.h:120
#define PSN_APPLY
Definition: prsht.h:117
WPARAM wParam
Definition: combotst.c:138
#define FALSE
Definition: types.h:117
#define PropSheet_Changed(d, w)
Definition: prsht.h:344
#define BN_CLICKED
Definition: winuser.h:1907
#define IDC_HIBERNATEFILE
Definition: resource.h:105
static VOID Hib_InitDialog(HWND hwndDlg)
Definition: hibernate.c:15
#define WM_COMMAND
Definition: winuser.h:1722
Definition: inflate.c:139
HWND WINAPI GetParent(_In_ HWND)
unsigned int UINT
Definition: ndis.h:50
INT_PTR Hib_SaveData(HWND hwndDlg)
Definition: hibernate.c:73
#define HIWORD(l)
Definition: typedefs.h:247
#define WM_INITDIALOG
Definition: winuser.h:1721
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
#define WM_NOTIFY
Definition: richedit.h:61

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 
833  pPageData = (PPOWER_SCHEMES_PAGE_DATA)GetWindowLongPtr(hwndDlg, DWLP_USER);
834 
835  switch (uMsg)
836  {
837  case WM_INITDIALOG:
840  sizeof(POWER_SCHEMES_PAGE_DATA));
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:
875  if (HIWORD(wParam) == CBN_SELCHANGE)
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 
890  case IDC_MONITORACLIST:
891  case IDC_MONITORDCLIST:
892  case IDC_DISKACLIST:
893  case IDC_DISKDCLIST:
894  case IDC_STANDBYACLIST:
895  case IDC_STANDBYDCLIST:
896  case IDC_HIBERNATEACLIST:
897  case IDC_HIBERNATEDCLIST:
898  if (HIWORD(wParam) == CBN_SELCHANGE)
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 }
struct _POWER_SCHEMES_PAGE_DATA * PPOWER_SCHEMES_PAGE_DATA
#define IDC_MONITORACLIST
Definition: resource.h:68
static VOID SaveScheme(HWND hwndDlg, PPOWER_SCHEMES_PAGE_DATA pPageData)
Definition: powershemes.c:674
static VOID Pos_SaveData(HWND hwndDlg, PPOWER_SCHEMES_PAGE_DATA pPageData)
Definition: powershemes.c:430
#define TRUE
Definition: types.h:120
#define IDC_MONITORDCLIST
Definition: resource.h:69
#define IDC_SAVEAS_BTN
Definition: resource.h:66
#define PSN_APPLY
Definition: prsht.h:117
#define PSN_SETACTIVE
Definition: prsht.h:115
#define SetWindowLongPtr
Definition: treelist.c:70
WPARAM wParam
Definition: combotst.c:138
struct _POWER_SCHEMES_PAGE_DATA POWER_SCHEMES_PAGE_DATA
static VOID DestroySchemesList(PPOWER_SCHEMES_PAGE_DATA pPageData)
Definition: powershemes.c:183
#define IDC_STANDBYDCLIST
Definition: resource.h:67
#define FALSE
Definition: types.h:117
#define IDC_ENERGYLIST
Definition: resource.h:59
smooth NULL
Definition: ftsmooth.c:416
#define IDC_DISKDCLIST
Definition: resource.h:71
static BOOL DelScheme(HWND hwnd, PPOWER_SCHEMES_PAGE_DATA pPageData)
Definition: powershemes.c:529
#define WM_DESTROY
Definition: winuser.h:1591
#define IDC_HIBERNATEACLIST
Definition: resource.h:73
#define _T(x)
Definition: vfdio.h:22
#define GetProcessHeap()
Definition: compat.h:484
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define IDC_HIBERNATEDCLIST
Definition: resource.h:74
#define PropSheet_Changed(d, w)
Definition: prsht.h:344
static VOID LoadConfig(HWND hwndDlg, PPOWER_SCHEMES_PAGE_DATA pPageData, PPOWER_SCHEME pScheme)
Definition: powershemes.c:237
static VOID BuildSchemesList(PPOWER_SCHEMES_PAGE_DATA pPageData)
Definition: powershemes.c:172
#define IDC_STANDBYACLIST
Definition: resource.h:66
#define IDC_DELETE_BTN
Definition: resource.h:67
#define DWLP_USER
Definition: winuser.h:866
#define MessageBox
Definition: winuser.h:5797
#define WM_COMMAND
Definition: winuser.h:1722
Definition: inflate.c:139
static BOOL CreateEnergyList(HWND hwndDlg, PPOWER_SCHEMES_PAGE_DATA pPageData)
Definition: powershemes.c:738
HWND WINAPI GetParent(_In_ HWND)
BOOLEAN Pos_InitData(HWND hwndDlg)
Definition: powershemes.c:205
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define MB_OK
Definition: winuser.h:784
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
#define CBN_SELCHANGE
Definition: winuser.h:1961
#define HIWORD(l)
Definition: typedefs.h:247
#define GetWindowLongPtr
Definition: treelist.c:73
#define IDC_DISKACLIST
Definition: resource.h:70
#define WM_INITDIALOG
Definition: winuser.h:1721
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
#define HeapFree(x, y, z)
Definition: compat.h:483
#define WM_NOTIFY
Definition: richedit.h:61

Referenced by Applet1().

Variable Documentation

◆ gGPP

◆ hApplet

HINSTANCE hApplet

Definition at line 17 of file access.c.