ReactOS  0.4.14-dev-114-gc8cbd56
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
 
POWER_POLICY gPP []
 

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 36 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:2050
#define TRUE
Definition: types.h:120
#define IDOK
Definition: winuser.h:824
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
smooth NULL
Definition: ftsmooth.c:416
#define WM_DESTROY
Definition: winuser.h:1591
#define GetProcessHeap()
Definition: compat.h:395
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:123
#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:394

Referenced by Applet1(), MainWindowProc(), and PanelOnCreate().

◆ 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:323
static BOOLEAN Ala_InitData(HWND hwndDlg)
Definition: alarms.c:15
WPARAM wParam
Definition: combotst.c:138
#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 83 of file hibernate.c.

87 {
88  switch (uMsg)
89  {
90  case WM_INITDIALOG:
91  Hib_InitDialog(hwndDlg);
92  return TRUE;
93 
94  case WM_COMMAND:
95  switch (LOWORD(wParam))
96  {
97  case IDC_HIBERNATEFILE:
98  if (HIWORD(wParam) == BN_CLICKED)
99  {
100  PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
101  }
102  break;
103  }
104  break;
105 
106  case WM_NOTIFY:
107  if (((LPNMHDR)lParam)->code == (UINT)PSN_APPLY)
108  {
109  return Hib_SaveData(hwndDlg);
110  }
111  break;
112  }
113 
114  return FALSE;
115 }
#define TRUE
Definition: types.h:120
#define PSN_APPLY
Definition: prsht.h:117
WPARAM wParam
Definition: combotst.c:138
#define PropSheet_Changed(d, w)
Definition: prsht.h:326
#define BN_CLICKED
Definition: winuser.h:1907
#define IDC_HIBERNATEFILE
Definition: resource.h:104
static VOID Hib_InitDialog(HWND hwndDlg)
Definition: hibernate.c:15
#define WM_COMMAND
Definition: winuser.h:1722
HWND WINAPI GetParent(_In_ HWND)
unsigned int UINT
Definition: ndis.h:50
INT_PTR Hib_SaveData(HWND hwndDlg)
Definition: hibernate.c:66
#define HIWORD(l)
Definition: typedefs.h:246
#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 808 of file powershemes.c.

813 {
814  PPOWER_SCHEMES_PAGE_DATA pPageData;
815 
816  pPageData = (PPOWER_SCHEMES_PAGE_DATA)GetWindowLongPtr(hwndDlg, DWLP_USER);
817 
818  switch (uMsg)
819  {
820  case WM_INITDIALOG:
823  sizeof(POWER_SCHEMES_PAGE_DATA));
824  SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pPageData);
825 
826  BuildSchemesList(pPageData);
827 
828  if (!Pos_InitData(hwndDlg))
829  {
830  // TODO:
831  // Initialization failed
832  // Handle error
833  MessageBox(hwndDlg,_T("Pos_InitData failed\n"), NULL, MB_OK);
834  }
835 
836  if (!CreateEnergyList(hwndDlg, pPageData))
837  {
838  // TODO:
839  // Initialization failed
840  // Handle error
841  MessageBox(hwndDlg,_T("CreateEnergyList failed\n"), NULL, MB_OK);
842  }
843  return TRUE;
844 
845  case WM_DESTROY:
846  if (pPageData)
847  {
848  DestroySchemesList(pPageData);
849  HeapFree(GetProcessHeap(), 0, pPageData);
851  }
852  break;
853 
854  case WM_COMMAND:
855  switch(LOWORD(wParam))
856  {
857  case IDC_ENERGYLIST:
858  if (HIWORD(wParam) == CBN_SELCHANGE)
859  {
860  LoadConfig(hwndDlg, pPageData, NULL);
861  PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
862  }
863  break;
864 
865  case IDC_DELETE_BTN:
866  DelScheme(hwndDlg, pPageData);
867  break;
868 
869  case IDC_SAVEAS_BTN:
870  SaveScheme(hwndDlg, pPageData);
871  break;
872 
873  case IDC_MONITORACLIST:
874  case IDC_MONITORDCLIST:
875  case IDC_DISKACLIST:
876  case IDC_DISKDCLIST:
877  case IDC_STANDBYACLIST:
878  case IDC_STANDBYDCLIST:
879  case IDC_HIBERNATEACLIST:
880  case IDC_HIBERNATEDCLIST:
881  if (HIWORD(wParam) == CBN_SELCHANGE)
882  {
883  PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
884  }
885  break;
886  }
887  break;
888 
889  case WM_NOTIFY:
890  switch (((LPNMHDR)lParam)->code)
891  {
892  case PSN_APPLY:
893  Pos_SaveData(hwndDlg, pPageData);
894  return TRUE;
895 
896  case PSN_SETACTIVE:
897  Pos_InitData(hwndDlg);
898  return TRUE;
899  }
900  break;
901  }
902 
903  return FALSE;
904 }
struct _POWER_SCHEMES_PAGE_DATA * PPOWER_SCHEMES_PAGE_DATA
#define IDC_MONITORACLIST
Definition: resource.h:67
static VOID SaveScheme(HWND hwndDlg, PPOWER_SCHEMES_PAGE_DATA pPageData)
Definition: powershemes.c:667
#define TRUE
Definition: types.h:120
static VOID Pos_SaveData(HWND hwndDlg, PPOWER_SCHEMES_PAGE_DATA pPageData)
Definition: powershemes.c:430
#define IDC_MONITORDCLIST
Definition: resource.h:68
#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:66
#define IDC_ENERGYLIST
Definition: resource.h:58
smooth NULL
Definition: ftsmooth.c:416
#define IDC_DISKDCLIST
Definition: resource.h:70
static BOOL DelScheme(HWND hwnd, PPOWER_SCHEMES_PAGE_DATA pPageData)
Definition: powershemes.c:530
#define WM_DESTROY
Definition: winuser.h:1591
#define IDC_HIBERNATEACLIST
Definition: resource.h:72
#define _T(x)
Definition: vfdio.h:22
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define IDC_HIBERNATEDCLIST
Definition: resource.h:73
#define PropSheet_Changed(d, w)
Definition: prsht.h:326
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:65
#define IDC_DELETE_BTN
Definition: resource.h:67
#define DWLP_USER
Definition: winuser.h:866
#define MessageBox
Definition: winuser.h:5723
#define WM_COMMAND
Definition: winuser.h:1722
static BOOL CreateEnergyList(HWND hwndDlg, PPOWER_SCHEMES_PAGE_DATA pPageData)
Definition: powershemes.c:721
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:123
#define CBN_SELCHANGE
Definition: winuser.h:1961
#define HIWORD(l)
Definition: typedefs.h:246
#define GetWindowLongPtr
Definition: treelist.c:73
#define IDC_DISKACLIST
Definition: resource.h:69
#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:394
#define WM_NOTIFY
Definition: richedit.h:61

Referenced by Applet1().

Variable Documentation

◆ gGPP

◆ gPP

POWER_POLICY gPP[]

◆ hApplet

HINSTANCE hApplet

Definition at line 17 of file access.c.