ReactOS  0.4.13-dev-52-g0efcfec
powershemes.c
Go to the documentation of this file.
1 /*
2  * PROJECT: ReactOS Power Configuration Applet
3  * LICENSE: GPL - See COPYING in the top level directory
4  * FILE: dll/cpl/powercfg/powershemes.c
5  * PURPOSE: powerschemes tab of applet
6  * PROGRAMMERS: Alexander Wurzinger (Lohnegrim at gmx dot net)
7  * Johannes Anderwald (johannes.anderwald@reactos.org)
8  * Martin Rottensteiner
9  * Dmitry Chapyshev (lentind@yandex.ru)
10  */
11 
12 #include "powercfg.h"
13 
15 {
16  60,
17  120,
18  180,
19  300,
20  600,
21  900,
22  1200,
23  1500,
24  1800,
25  2700,
26  3600,
27  7200,
28  10800,
29  14400,
30  18000,
31  0
32 };
33 
34 HWND hList = 0;
35 HWND hPos = 0;
36 
37 unsigned aps = 0;
38 
39 #define MAX_POWER_POLICY 20
40 
44 
45 
46 BOOLEAN
48 {
50 /*
51  RECT rectCtl, rectDlg, rectCtl2;
52  LONG movetop = 0;
53  LONG moveright = 0;
54 
55  if (GetWindowRect(hPos,&rectDlg))
56  {
57  if (GetWindowRect(GetDlgItem(hPos, IDC_SAT),&rectCtl2))
58  {
59  if (GetWindowRect(GetDlgItem(hPos, IDC_MONITOR),&rectCtl))
60  {
61  movetop=rectCtl.top - rectCtl2.top;
62  MoveWindow(GetDlgItem(hPos, IDC_MONITOR),rectCtl.left-rectDlg.left,rectCtl.top-rectDlg.top-movetop,rectCtl.right-rectCtl.left,rectCtl.bottom-rectCtl.top,FALSE);
63  if (GetWindowRect(GetDlgItem(hPos, IDC_DISK),&rectCtl))
64  {
65  MoveWindow(GetDlgItem(hPos, IDC_DISK),rectCtl.left-rectDlg.left,rectCtl.top-rectDlg.top-movetop,rectCtl.right-rectCtl.left,rectCtl.bottom-rectCtl.top,FALSE);
66  }
67  if (GetWindowRect(GetDlgItem(hPos, IDC_STANDBY),&rectCtl))
68  {
69  MoveWindow(GetDlgItem(hPos, IDC_STANDBY),rectCtl.left-rectDlg.left,rectCtl.top-rectDlg.top-movetop,rectCtl.right-rectCtl.left,rectCtl.bottom-rectCtl.top,FALSE);
70  }
71  if (GetWindowRect(GetDlgItem(hPos, IDC_HYBERNATE),&rectCtl))
72  {
73  MoveWindow(GetDlgItem(hPos, IDC_HYBERNATE),rectCtl.left-rectDlg.left,rectCtl.top-rectDlg.top-movetop,rectCtl.right-rectCtl.left,rectCtl.bottom-rectCtl.top,FALSE);
74  }
75  if (GetWindowRect(GetDlgItem(hPos, IDC_MONITORDCLIST),&rectCtl2))
76  {
77  movetop=movetop-8;
78  if (GetWindowRect(GetDlgItem(hPos, IDC_MONITORACLIST),&rectCtl))
79  {
80  moveright=rectCtl.right - rectCtl2.right;
81  MoveWindow(GetDlgItem(hPos, IDC_MONITORACLIST),rectCtl.left-rectDlg.left,rectCtl.top-rectDlg.top-movetop,rectCtl.right-rectCtl.left-moveright,rectCtl.bottom-rectCtl.top,FALSE);
82  if (GetWindowRect(GetDlgItem(hPos, IDC_DISKACLIST),&rectCtl))
83  {
84  MoveWindow(GetDlgItem(hPos, IDC_DISKACLIST),rectCtl.left-rectDlg.left,rectCtl.top-rectDlg.top-movetop,rectCtl.right-rectCtl.left-moveright,rectCtl.bottom-rectCtl.top,FALSE);
85  }
86  if (GetWindowRect(GetDlgItem(hPos, IDC_STANDBYACLIST),&rectCtl))
87  {
88  MoveWindow(GetDlgItem(hPos, IDC_STANDBYACLIST),rectCtl.left-rectDlg.left,rectCtl.top-rectDlg.top-movetop,rectCtl.right-rectCtl.left-moveright,rectCtl.bottom-rectCtl.top,FALSE);
89  }
90  if (GetWindowRect(GetDlgItem(hPos, IDC_HYBERNATEACLIST),&rectCtl))
91  {
92  MoveWindow(GetDlgItem(hPos, IDC_HYBERNATEACLIST),rectCtl.left-rectDlg.left,rectCtl.top-rectDlg.top-movetop,rectCtl.right-rectCtl.left-moveright,rectCtl.bottom-rectCtl.top,FALSE);
93  }
94  }
95  if (GetWindowRect(GetDlgItem(hPos, IDC_GRPDETAIL),&rectCtl))
96  {
97  MoveWindow(GetDlgItem(hPos, IDC_GRPDETAIL),rectCtl.left-rectDlg.left,rectCtl.top-rectDlg.top,rectCtl.right-rectCtl.left,rectCtl.bottom-rectCtl.top,FALSE);
98  }
99  }
100  }
101  }
102  }
103  }
104 */
105 
106  if (!GetPwrCapabilities(&spc))
107  {
108  return FALSE;
109  }
110 
111  if (!spc.SystemBatteriesPresent)
112  {
123 
124  }
125  else
126  {
129  }
130 
131 
132  if (!(spc.SystemS1 ||spc.SystemS2 || spc.SystemS3))
133  {
137  }
138 
140 
141  return TRUE;
142 }
143 
144 
145 static VOID
146 LoadConfig(HWND hwndDlg)
147 {
148  INT i=0, iCurSel=0;
149  UINT uiIndex;
150  TCHAR szProfile[MAX_PATH];
151  TCHAR szTemp[MAX_PATH];
152  TCHAR szConfig[MAX_PATH];
154 
155  iCurSel = (INT)SendDlgItemMessage(hwndDlg, IDC_ENERGYLIST,
156  CB_GETCURSEL,
157  0,
158  0);
159  if (iCurSel == CB_ERR)
160  return;
161 
162  memcpy(&pp, &gPP[iCurSel], sizeof(POWER_POLICY));
163 
164  uiIndex = (UINT)SendDlgItemMessage(hwndDlg, IDC_ENERGYLIST, CB_GETCURSEL, 0, 0);
165  if(uiIndex != (UINT)CB_ERR)
166  {
167  SendDlgItemMessage(hwndDlg, IDC_ENERGYLIST, CB_GETLBTEXT, uiIndex, (LPARAM)szProfile);
168  if(LoadString(hApplet, IDS_CONFIG1, szTemp, MAX_PATH))
169  {
170  _stprintf(szConfig,szTemp,szProfile);
171  SetWindowText(GetDlgItem(hwndDlg, IDC_GRPDETAIL),szConfig);
172  }
173  }
174 
175  for(i=0;i<16;i++)
176  {
177  if (Sec[i]==pp.user.VideoTimeoutAc)
178  {
180  CB_SETCURSEL,
181  i,
182  (LPARAM)0);
183  }
184 
185  if (Sec[i]==pp.user.VideoTimeoutDc)
186  {
188  CB_SETCURSEL,
189  i,
190  (LPARAM)0);
191  }
192  if (Sec[i]==pp.user.SpindownTimeoutAc)
193  {
195  CB_SETCURSEL,
196  i-2,
197  (LPARAM)0);
198  }
199  if (Sec[i]==pp.user.SpindownTimeoutDc) // IdleTimeoutDc)
200  {
202  CB_SETCURSEL,
203  i-2,
204  (LPARAM)0);
205  }
206  if (Sec[i]==pp.user.IdleTimeoutAc)
207  {
209  CB_SETCURSEL,
210  i,
211  (LPARAM)0);
212  }
213  if (Sec[i]==pp.user.IdleTimeoutDc)
214  {
216  CB_SETCURSEL,
217  i,
218  (LPARAM)0);
219  }
220 
221  if (Sec[i]==pp.mach.DozeS4TimeoutAc)
222  {
224  CB_SETCURSEL,
225  i,
226  (LPARAM)0);
227  }
228  if (Sec[i]==pp.mach.DozeS4TimeoutDc)
229  {
231  CB_SETCURSEL,
232  i,
233  (LPARAM)0);
234  }
235  }
236 }
237 
238 
240 callback_EnumPwrScheme(UINT uiIndex, DWORD dwName, LPTSTR sName, DWORD dwDesc,
242 {
243  int index;
244 
246  UNREFERENCED_PARAMETER(sDesc);
247  UNREFERENCED_PARAMETER(dwDesc);
248  UNREFERENCED_PARAMETER(dwName);
249 
250  if (ValidatePowerPolicies(0,pp))
251  {
252  if (guiIndex >= MAX_POWER_POLICY)
253  {
254  // FIXME:
255  // Implement store power policy dynamically
256  return FALSE;
257  }
258 
259 
260  memcpy(&gPP[guiIndex], pp, sizeof(POWER_POLICY));
261  guiIndex++;
262 
264  CB_ADDSTRING,
265  0,
266  (LPARAM)sName);
267  if (index == CB_ERR)
268  return FALSE;
269 
272  index,
273  (LPARAM)uiIndex);
274 
275  if (aps == uiIndex)
276  {
279  TRUE,
280  (LPARAM)sName);
282  }
283  }
284  return TRUE;
285 }
286 
287 
288 static VOID
290 {
291  int ifrom=0,i=0,imin=0;
292  HWND hwnd = NULL;
294  LRESULT index;
295 
296  for(i=1;i<9;i++)
297  {
298  switch(i)
299  {
300  case 1:
302  imin=IDS_TIMEOUT1;
303  break;
304  case 2:
306  imin=IDS_TIMEOUT1;
307  break;
308  case 3:
309  hwnd=GetDlgItem(hwndDlg, IDC_DISKACLIST);
310  imin=IDS_TIMEOUT3;
311  break;
312  case 4:
314  imin=IDS_TIMEOUT3;
315  break;
316  case 5:
318  imin=IDS_TIMEOUT1;
319  break;
320  case 6:
322  imin=IDS_TIMEOUT1;
323  break;
324  case 7:
325  hwnd=GetDlgItem(hwndDlg, IDC_DISKDCLIST);
326  imin=IDS_TIMEOUT3;
327  break;
328  case 8:
330  imin=IDS_TIMEOUT3;
331  break;
332  default:
333  return;
334  }
335  for (ifrom=imin;ifrom<(IDS_TIMEOUT15+1);ifrom++)
336  {
337  if (LoadString(hApplet, ifrom, szName, MAX_PATH))
338  {
340  CB_ADDSTRING,
341  0,
342  (LPARAM)szName);
343 
344  if (index == CB_ERR)
345  return;
346 
349  index,
350  (LPARAM)Sec[ifrom-IDS_TIMEOUT16]);
351  }
352  }
354  {
356  CB_ADDSTRING,
357  0,
358  (LPARAM)szName);
359  if (index == CB_ERR)
360  return;
361 
364  index,
365  (LPARAM)Sec[0]);
366  }
367  }
368 }
369 
370 
371 static VOID
373 {
374  INT iCurSel=0,tmp=0;
375 
376  iCurSel = (INT) SendDlgItemMessage(hwndDlg, IDC_ENERGYLIST,
377  CB_GETCURSEL,
378  0,
379  0);
380  if (iCurSel == CB_ERR)
381  return;
382 
383  tmp = (INT) SendDlgItemMessage(hwndDlg, IDC_MONITORDCLIST,
384  CB_GETCURSEL,
385  0,
386  (LPARAM)0);
387  if (tmp > 0 && tmp < 16)
388  {
389  gPP[iCurSel].user.VideoTimeoutAc = Sec[tmp];
390  }
391  tmp = (INT) SendDlgItemMessage(hwndDlg, IDC_MONITORDCLIST,
392  CB_GETCURSEL,
393  0,
394  (LPARAM)0);
395  if (tmp > 0 && tmp < 16)
396  {
397  gPP[iCurSel].user.VideoTimeoutDc = Sec[tmp];
398  }
399  tmp = (INT) SendDlgItemMessage(hwndDlg, IDC_DISKACLIST,
400  CB_GETCURSEL,
401  0,
402  (LPARAM)0);
403  if (tmp > 0 && tmp < 16)
404  {
405  gPP[iCurSel].user.SpindownTimeoutAc = Sec[tmp+2];
406  }
407  tmp = (INT) SendDlgItemMessage(hwndDlg, IDC_DISKDCLIST,
408  CB_GETCURSEL,
409  0,
410  (LPARAM)0);
411  if (tmp > 0 && tmp < 16)
412  {
413  gPP[iCurSel].user.SpindownTimeoutDc = Sec[tmp+2];
414  }
415  tmp = (INT) SendDlgItemMessage(hwndDlg, IDC_STANDBYACLIST,
416  CB_GETCURSEL,
417  0,
418  (LPARAM)0);
419  if (tmp > 0 && tmp < 16)
420  {
421  gPP[iCurSel].user.IdleTimeoutAc = Sec[tmp];
422  }
423  tmp = (INT) SendDlgItemMessage(hwndDlg, IDC_STANDBYDCLIST,
424  CB_GETCURSEL,
425  0,
426  (LPARAM)0);
427  if (tmp > 0 && tmp < 16)
428  {
429  gPP[iCurSel].user.IdleTimeoutDc = Sec[tmp];
430  }
431  tmp = (INT) SendDlgItemMessage(hwndDlg, IDC_HYBERNATEACLIST,
432  CB_GETCURSEL,
433  0,
434  (LPARAM)0);
435  if (tmp > 0 && tmp < 16)
436  {
437  gPP[iCurSel].mach.DozeS4TimeoutAc = Sec[tmp];
438  }
439  tmp = (INT) SendDlgItemMessage(hwndDlg, IDC_HYBERNATEDCLIST,
440  CB_GETCURSEL,
441  0,
442  (LPARAM)0);
443  if (tmp > 0 && tmp < 16)
444  {
445  gPP[iCurSel].mach.DozeS4TimeoutDc = Sec[tmp];
446  }
447 
448  SetActivePwrScheme(iCurSel,NULL,&gPP[iCurSel]);
449  LoadConfig(hwndDlg);
450 }
451 
452 
453 static BOOLEAN
455 {
456  INT iCurSel;
457  HWND hList;
458  TCHAR szBuf[1024], szBufT[1024];
459  UINT DelScheme;
460 
462 
463  iCurSel = SendMessage(hList, CB_GETCURSEL, 0, 0);
464  if (iCurSel == CB_ERR) return FALSE;
465 
466  SendMessage(hList, CB_SETCURSEL, iCurSel, 0);
467 
469  if (DelScheme == (UINT)CB_ERR) return FALSE;
470 
471  LoadString(hApplet, IDS_DEL_SCHEME_TITLE, szBufT, sizeof(szBufT) / sizeof(TCHAR));
472  LoadString(hApplet, IDS_DEL_SCHEME, szBuf, sizeof(szBuf) / sizeof(TCHAR));
473 
474  if (MessageBox(hwnd, szBuf, szBufT, MB_YESNO | MB_ICONQUESTION) == IDYES)
475  {
476  UINT Current;
477 
478  if (GetActivePwrScheme(&Current))
479  {
481  SendMessage(hList, CB_DELETESTRING, (WPARAM)iCurSel, 0);
482  if (Current == DelScheme) Pos_SaveData(hwnd);
483  }
484 
485  if (DeletePwrScheme(DelScheme) != 0) return TRUE;
486  }
487 
488  return FALSE;
489 }
490 
491 
492 static BOOLEAN
494 {
495  BOOLEAN retval;
498 
499  hList = hwnd;
500 
501  if (!GetActivePwrScheme(&aps))
502  return FALSE;
503 
504  if (!ReadGlobalPwrPolicy(&gGPP))
505  return FALSE;
506 
507  if (!ReadPwrScheme(aps,&pp))
508  return FALSE;
509 
510  if (!ValidatePowerPolicies(&gGPP,0))
511  return FALSE;
512 
513 /*
514  if (!SetActivePwrScheme(aps,&gGPP,&pp))
515  return FALSE;
516 */
517 
518  if (!GetPwrCapabilities(&spc))
519  return FALSE;
520 
521  if (CanUserWritePwrScheme())
522  {
523  // TODO:
524  // Enable write / delete powerscheme button
525  }
526 
528 
529  if (!GetActivePwrScheme(&aps))
530  return FALSE;
531 
533 
534  if(SendMessage(hwnd, CB_GETCOUNT, 0, 0) > 0)
535  {
538  }
539 
540  return retval;
541 }
542 
543 
544 /* Property page dialog callback */
547  HWND hwndDlg,
548  UINT uMsg,
549  WPARAM wParam,
550  LPARAM lParam
551 )
552 {
553  switch(uMsg)
554  {
555  case WM_INITDIALOG:
556  hPos = hwndDlg;
557  hwndDialog = hwndDlg;
558  if (!Pos_InitData())
559  {
560  // TODO:
561  // Initialization failed
562  // Handle error
563  MessageBox(hwndDlg,_T("Pos_InitData failed\n"), NULL, MB_OK);
564 
565  }
567  {
568  // TODO:
569  // Initialization failed
570  // Handle error
571  MessageBox(hwndDlg,_T("CreateEnergyList failed\n"), NULL, MB_OK);
572  }
573  return TRUE;
574  case WM_COMMAND:
575  switch(LOWORD(wParam))
576  {
577  case IDC_ENERGYLIST:
578  if (HIWORD(wParam) == CBN_SELCHANGE)
579  {
580  LoadConfig(hwndDlg);
581  PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
582  }
583  break;
584  case IDC_DELETE_BTN:
585  {
586  DelScheme(hwndDlg);
587  }
588  break;
589  case IDC_SAVEAS_BTN:
590  {
591 
592  }
593  break;
594  case IDC_MONITORACLIST:
595  case IDC_MONITORDCLIST:
596  case IDC_DISKACLIST:
597  case IDC_DISKDCLIST:
598  case IDC_STANDBYACLIST:
599  case IDC_STANDBYDCLIST:
600  case IDC_HYBERNATEACLIST:
601  case IDC_HYBERNATEDCLIST:
602  if (HIWORD(wParam) == CBN_SELCHANGE)
603  {
604  PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
605  }
606  break;
607  }
608  break;
609  case WM_NOTIFY:
610  {
611  LPNMHDR lpnm = (LPNMHDR)lParam;
612  if (lpnm->code == (UINT)PSN_APPLY)
613  {
614  Pos_SaveData(hwndDlg);
615  }
616  return TRUE;
617  }
618  break;
619  }
620  return FALSE;
621 }
#define IDC_HYBERNATEDCLIST
Definition: resource.h:71
#define CB_SETITEMDATA
Definition: winuser.h:1927
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define IDC_MONITORACLIST
Definition: resource.h:65
#define TRUE
Definition: types.h:120
#define IDS_TIMEOUT1
Definition: resource.h:31
#define IDYES
Definition: winuser.h:829
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
#define CB_GETLBTEXT
Definition: winuser.h:1913
BOOLEAN WINAPI SetActivePwrScheme(UINT uiID, PGLOBAL_POWER_POLICY lpGlobalPowerPolicy, PPOWER_POLICY lpPowerPolicy)
Definition: powrprof.c:642
#define IDC_MONITORDCLIST
Definition: resource.h:66
#define CB_GETITEMDATA
Definition: winuser.h:1911
#define INT
Definition: polytest.cpp:20
#define CALLBACK
Definition: compat.h:27
BOOLEAN SystemBatteriesPresent
Definition: ntpoapi.h:374
BOOLEAN WINAPI GetPwrCapabilities(PSYSTEM_POWER_CAPABILITIES lpSystemPowerCapabilities)
Definition: powrprof.c:358
HINSTANCE hApplet
Definition: access.c:17
BOOLEAN WINAPI ReadPwrScheme(UINT uiID, PPOWER_POLICY pPowerPolicy)
Definition: powrprof.c:610
#define IDC_SAVEAS_BTN
Definition: resource.h:66
UINT_PTR WPARAM
Definition: windef.h:207
#define SendDlgItemMessage
Definition: winuser.h:5708
#define PSN_APPLY
Definition: prsht.h:117
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
int32_t INT_PTR
Definition: typedefs.h:62
static BOOLEAN DelScheme(HWND hwnd)
Definition: powershemes.c:454
int32_t INT
Definition: typedefs.h:56
#define CB_GETCURSEL
Definition: winuser.h:1904
WPARAM wParam
Definition: combotst.c:138
static VOID LoadConfig(HWND hwndDlg)
Definition: powershemes.c:146
CHAR * LPTSTR
Definition: xmlstorage.h:192
struct tagNMHDR * LPNMHDR
HWND hList
Definition: powershemes.c:34
#define IDS_CONFIG1
Definition: resource.h:11
#define IDC_STANDBY
Definition: resource.h:74
#define IDC_IAC
Definition: resource.h:59
UINT code
Definition: winuser.h:3112
#define MAX_POWER_POLICY
Definition: powershemes.c:39
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define IDC_STANDBYDCLIST
Definition: resource.h:64
ULONG SpindownTimeoutDc
Definition: powrprof.h:82
#define MB_YESNO
Definition: winuser.h:811
ULONG SpindownTimeoutAc
Definition: powrprof.h:81
#define IDC_HYBERNATE
Definition: resource.h:72
#define IDC_ENERGYLIST
Definition: resource.h:56
#define pp
Definition: hlsl.yy.c:978
#define CB_ADDSTRING
Definition: winuser.h:1897
unsigned char BOOLEAN
smooth NULL
Definition: ftsmooth.c:416
#define MB_ICONQUESTION
Definition: winuser.h:783
#define IDC_DISKDCLIST
Definition: resource.h:68
LONG_PTR LPARAM
Definition: windef.h:208
MACHINE_POWER_POLICY mach
Definition: powrprof.h:92
GLuint index
Definition: glext.h:6031
#define CB_ERR
Definition: winuser.h:2389
#define IDC_SAT
Definition: resource.h:58
USER_POWER_POLICY user
Definition: powrprof.h:91
GLOBAL_POWER_POLICY gGPP
Definition: powercfg.c:23
char TCHAR
Definition: xmlstorage.h:189
POWER_POLICY gPP[MAX_POWER_POLICY]
Definition: powershemes.c:41
#define _T(x)
Definition: vfdio.h:22
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define PropSheet_Changed(d, w)
Definition: prsht.h:326
ULONG VideoTimeoutAc
Definition: powrprof.h:79
#define MAX_PATH
Definition: compat.h:26
#define IDC_SAC
Definition: resource.h:60
BOOLEAN WINAPI EnumPwrSchemes(PWRSCHEMESENUMPROC lpfnPwrSchemesEnumProc, LPARAM lParam)
Definition: powrprof.c:219
BOOLEAN WINAPI GetActivePwrScheme(PUINT puiID)
Definition: powrprof.c:285
unsigned long DWORD
Definition: ntddk_ex.h:95
#define IDS_DEL_SCHEME_TITLE
Definition: resource.h:47
#define IDC_STANDBYACLIST
Definition: resource.h:63
#define IDC_DELETE_BTN
Definition: resource.h:67
#define index(s, c)
Definition: various.h:29
static BOOLEAN CreateEnergyList(HWND hwnd)
Definition: powershemes.c:493
#define CB_SELECTSTRING
Definition: winuser.h:1921
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
BOOLEAN WINAPI ValidatePowerPolicies(PGLOBAL_POWER_POLICY pGPP, PPOWER_POLICY pPP)
Definition: powrprof.c:851
#define MessageBox
Definition: winuser.h:5688
#define CB_SETCURSEL
Definition: winuser.h:1922
#define WM_COMMAND
Definition: winuser.h:1716
ULONG VideoTimeoutDc
Definition: powrprof.h:80
static VOID Pos_InitPage(HWND hwndDlg)
Definition: powershemes.c:289
UINT Sec[]
Definition: powershemes.c:14
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
#define _stprintf
Definition: utility.h:124
HWND WINAPI GetParent(_In_ HWND)
#define IDS_TIMEOUT15
Definition: resource.h:45
#define IDS_TIMEOUT16
Definition: resource.h:30
#define IDC_SDC
Definition: resource.h:62
static VOID Pos_SaveData(HWND hwndDlg)
Definition: powershemes.c:372
#define IDS_TIMEOUT3
Definition: resource.h:33
BOOLEAN WINAPI ReadGlobalPwrPolicy(PGLOBAL_POWER_POLICY pGlobalPowerPolicy)
Definition: powrprof.c:521
BOOLEAN WINAPI CanUserWritePwrScheme(VOID)
Definition: powrprof.c:79
#define SetWindowText
Definition: winuser.h:5723
#define IDC_GRPDETAIL
Definition: resource.h:57
unsigned int UINT
Definition: ndis.h:50
#define MB_OK
Definition: winuser.h:784
#define CBN_SELCHANGE
Definition: winuser.h:1940
#define IDC_HYBERNATEACLIST
Definition: resource.h:70
#define IDS_DEL_SCHEME
Definition: resource.h:46
static const WCHAR szName[]
Definition: msipriv.h:1194
#define SendMessage
Definition: winuser.h:5709
UINT guiIndex
Definition: powershemes.c:42
BOOLEAN Pos_InitData(VOID)
Definition: powershemes.c:47
#define HIWORD(l)
Definition: typedefs.h:246
ULONG IdleTimeoutDc
Definition: powrprof.h:71
#define CB_GETCOUNT
Definition: winuser.h:1903
#define IDC_DISKACLIST
Definition: resource.h:67
INT_PTR CALLBACK PowerSchemesDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: powershemes.c:546
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define CB_DELETESTRING
Definition: winuser.h:1898
LONG_PTR LRESULT
Definition: windef.h:209
BOOLEAN CALLBACK callback_EnumPwrScheme(UINT uiIndex, DWORD dwName, LPTSTR sName, DWORD dwDesc, LPWSTR sDesc, PPOWER_POLICY pp, LPARAM lParam)
Definition: powershemes.c:240
ULONG IdleTimeoutAc
Definition: powrprof.h:70
BOOLEAN WINAPI DeletePwrScheme(UINT uiIndex)
Definition: powrprof.c:99
#define WM_INITDIALOG
Definition: winuser.h:1715
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
#define IDC_IDC
Definition: resource.h:61
unsigned aps
Definition: powershemes.c:37
#define LoadString
Definition: winuser.h:5685
HWND hPos
Definition: powershemes.c:35
#define WM_NOTIFY
Definition: richedit.h:61
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31
HWND hwndDialog
Definition: powershemes.c:43