[ros-diffs] [janderwald] 22362: * implementation of Power Panel Control Applet * developed by Alex Wurzinger, Johannes Anderwald & Martin Rottensteiner

janderwald at svn.reactos.org janderwald at svn.reactos.org
Thu Jun 15 16:07:09 CEST 2006


Author: janderwald
Date: Thu Jun 15 18:07:08 2006
New Revision: 22362

URL: http://svn.reactos.ru/svn/reactos?rev=22362&view=rev
Log:
* implementation of Power Panel Control Applet
* developed by Alex Wurzinger, Johannes Anderwald & Martin Rottensteiner 

Added:
    trunk/reactos/dll/cpl/powercfg/
    trunk/reactos/dll/cpl/powercfg/advanced.c
    trunk/reactos/dll/cpl/powercfg/alarms.c
    trunk/reactos/dll/cpl/powercfg/de.rc
    trunk/reactos/dll/cpl/powercfg/en.rc
    trunk/reactos/dll/cpl/powercfg/hibernate.c
    trunk/reactos/dll/cpl/powercfg/powercfg.c
    trunk/reactos/dll/cpl/powercfg/powercfg.def
    trunk/reactos/dll/cpl/powercfg/powercfg.h
    trunk/reactos/dll/cpl/powercfg/powercfg.rbuild
    trunk/reactos/dll/cpl/powercfg/powercfg.rc
    trunk/reactos/dll/cpl/powercfg/powershemes.c
    trunk/reactos/dll/cpl/powercfg/resource.h
    trunk/reactos/dll/cpl/powercfg/resources/
    trunk/reactos/dll/cpl/powercfg/resources/ac.ico   (with props)
    trunk/reactos/dll/cpl/powercfg/resources/acdc.ico   (with props)
    trunk/reactos/dll/cpl/powercfg/resources/batterycharging.ico   (with props)
    trunk/reactos/dll/cpl/powercfg/resources/batterychargingcritical.ico   (with props)
    trunk/reactos/dll/cpl/powercfg/resources/batterycharginghalf.ico   (with props)
    trunk/reactos/dll/cpl/powercfg/resources/batterycharginghigh.ico   (with props)
    trunk/reactos/dll/cpl/powercfg/resources/batterycharginglow.ico   (with props)
    trunk/reactos/dll/cpl/powercfg/resources/batterycritical.ico   (with props)
    trunk/reactos/dll/cpl/powercfg/resources/batteryfull.ico   (with props)
    trunk/reactos/dll/cpl/powercfg/resources/batteryhalf.ico   (with props)
    trunk/reactos/dll/cpl/powercfg/resources/batteryhigh.ico   (with props)
    trunk/reactos/dll/cpl/powercfg/resources/batterylow.ico   (with props)
    trunk/reactos/dll/cpl/powercfg/resources/batteryunknown.ico   (with props)
    trunk/reactos/dll/cpl/powercfg/resources/dc.ico   (with props)
    trunk/reactos/dll/cpl/powercfg/resources/nobattery.ico   (with props)
    trunk/reactos/dll/cpl/powercfg/resources/screen.ico   (with props)

Added: trunk/reactos/dll/cpl/powercfg/advanced.c
URL: http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/cpl/powercfg/advanced.c?rev=22362&view=auto
==============================================================================
--- trunk/reactos/dll/cpl/powercfg/advanced.c (added)
+++ trunk/reactos/dll/cpl/powercfg/advanced.c Thu Jun 15 18:07:08 2006
@@ -1,0 +1,531 @@
+/* $Id: advanced.c 21500 2006-04-07 10:20:39Z janderwald $
+ *
+ * PROJECT:         ReactOS Power Configuration Applet
+ * LICENSE:         GPL - See COPYING in the top level directory
+ * FILE:            dll/cpl/powercfg/advanced.c
+ * PURPOSE:         advanced tab of applet
+ * PROGRAMMERS:     Alexander Wurzinger (Lohnegrim at gmx dot net)
+ *                  Johannes Anderwald (johannes.anderwald at student.tugraz.at)
+ *                  Martin Rottensteiner
+ */
+
+#include "ntstatus.h"
+#define WIN32_NO_STATUS
+#include <windows.h>
+#include <commctrl.h>
+#include <cpl.h>
+#include "resource.h"
+#include "powercfg.h"
+#include "powrprof.h"
+
+HWND hAdv=0;
+
+void Adv_InitDialog();
+void Adv_SaveData(HWND hwndDlg);
+
+static POWER_ACTION g_SystemBatteries[3];
+static POWER_ACTION g_PowerButton[5];
+static POWER_ACTION g_SleepButton[5];
+
+/* Property page dialog callback */
+INT_PTR CALLBACK
+advancedProc(
+  HWND hwndDlg,
+  UINT uMsg,
+  WPARAM wParam,
+  LPARAM lParam
+)
+{
+  switch(uMsg)
+  {
+    case WM_INITDIALOG:
+		hAdv = hwndDlg;
+		Adv_InitDialog();
+		return TRUE;
+      break;
+	case WM_COMMAND:
+		switch(LOWORD(wParam))
+		{
+		case IDC_SYSTRAYBATTERYMETER:
+		case IDC_PASSWORDLOGON:
+		case IDC_VIDEODIMDISPLAY:
+			if (HIWORD(wParam) == BN_CLICKED)
+			{
+				PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
+			}
+			break;
+		case IDC_LIDCLOSE:
+		case IDC_POWERBUTTON:
+		case IDC_SLEEPBUTTON:
+			if (HIWORD(wParam) == CBN_SELCHANGE)
+			{
+				PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
+			}
+			break;
+		}
+		break;
+	case WM_NOTIFY:
+		{
+			LPNMHDR lpnm = (LPNMHDR)lParam;
+			if (lpnm->code == (UINT)PSN_APPLY)
+			{
+				Adv_SaveData(hwndDlg);
+			}
+			return TRUE;
+		}
+  }
+  return FALSE;
+}
+
+static void AddItem(HWND hDlgCtrl, int ResourceId, LPARAM lParam, POWER_ACTION * lpAction)
+{
+  TCHAR szBuffer[MAX_PATH];
+  LRESULT Index;
+  if (LoadString(hApplet, ResourceId, szBuffer, MAX_PATH) < MAX_PATH)
+  {
+	Index = SendMessage(hDlgCtrl, CB_ADDSTRING, 0, (LPARAM)szBuffer);
+    if (Index != CB_ERR)
+	{
+		SendMessage(hDlgCtrl, CB_SETITEMDATA, (WPARAM)Index, lParam);
+		lpAction[Index] = (POWER_ACTION)lParam;
+	}
+  }
+}
+
+static int FindActionIndex(POWER_ACTION * lpAction, DWORD dwActionSize, POWER_ACTION poAction)
+{
+  int Index;
+
+  for (Index = 0; Index < dwActionSize; Index++)
+  {
+	if (lpAction[Index] == poAction)
+	    return Index;
+  }
+
+  return -1;
+}
+
+static BOOLEAN IsBatteryUsed()
+{
+	SYSTEM_BATTERY_STATE sbs;
+
+	if (CallNtPowerInformation(SystemBatteryState,NULL, (ULONG)NULL, &sbs, sizeof(SYSTEM_BATTERY_STATE)) == STATUS_SUCCESS)
+	{
+		if (sbs.BatteryPresent)
+		{
+			if (sbs.AcOnLine)
+			{
+				return FALSE;
+			}
+			return TRUE;
+		}
+		return FALSE;
+	}
+
+	return FALSE;
+}
+
+POWER_ACTION GetPowerActionFromPolicy(POWER_ACTION_POLICY * Policy)
+{
+	POWER_ACTION poAction = PowerActionNone;
+	/*
+
+	TCHAR szBuffer[MAX_PATH];
+	
+	// Note: Windows XP SP2+ does not return the PowerAction code
+	// for PowerActionWarmEject + PowerActionShutdown but sets it
+	// to PowerActionNone and sets the Flags & EventCode 
+	
+	
+	 swprintf(szBuffer, L"Action: %x EventCode %x Flags %x",Policy->Action, Policy->EventCode, Policy->Flags);
+	 MessageBoxW(NULL, szBuffer, NULL, MB_OK);
+	
+	*/
+
+	if (Policy->Action == PowerActionNone)
+	{
+		if (Policy->Flags == (POWER_ACTION_UI_ALLOWED | POWER_ACTION_QUERY_ALLOWED))
+		{
+			if (Policy->EventCode  == POWER_FORCE_TRIGGER_RESET)
+			{
+				poAction = PowerActionNone;
+			}
+			else if (Policy->EventCode  == POWER_USER_NOTIFY_BUTTON)
+			{
+				poAction = PowerActionWarmEject;
+			}
+			else if (Policy->EventCode == POWER_USER_NOTIFY_SHUTDOWN)
+			{
+				poAction = PowerActionShutdown;
+			}
+		}
+	}
+	else
+	{
+		poAction = Policy->Action;
+	}
+	
+	return poAction;
+}
+
+void ShowCurrentPowerActionPolicy(HWND hDlgCtrl, 
+									POWER_ACTION * lpAction, 
+									DWORD dwActionSize, 
+									POWER_ACTION_POLICY * Policy)
+{
+	int poActionIndex;
+	POWER_ACTION poAction;
+
+	poAction = GetPowerActionFromPolicy(Policy);
+	poActionIndex = FindActionIndex(lpAction, dwActionSize, poAction);
+
+	if (poActionIndex < 0)
+	{
+		return;
+	}
+
+	SendMessage(hDlgCtrl, CB_SETCURSEL, (WPARAM)poActionIndex, (LPARAM)0);
+}
+
+BOOLEAN SaveCurrentPowerActionPolicy(IN HWND hDlgCtrl,
+									 OUT POWER_ACTION_POLICY * Policy)
+{
+	LRESULT Index;
+	LRESULT ItemData;
+
+	Index = SendMessage(hDlgCtrl, CB_GETCURSEL, 0, 0);
+	if (Index == CB_ERR)
+		return FALSE;
+
+	ItemData = SendMessage(hDlgCtrl, CB_GETITEMDATA, (WPARAM)Index, 0);
+	if (ItemData == CB_ERR)
+		return FALSE;
+
+	switch(ItemData)
+	{
+	case PowerActionNone:
+		Policy->Action = PowerActionNone;
+		Policy->EventCode  = POWER_FORCE_TRIGGER_RESET;
+		break;
+	case PowerActionWarmEject:
+		Policy->Action = PowerActionNone;
+		Policy->EventCode  = POWER_USER_NOTIFY_BUTTON;
+		break;
+	case PowerActionShutdown:
+		Policy->Action = PowerActionNone;
+		Policy->EventCode = POWER_USER_NOTIFY_SHUTDOWN;
+		break;
+	case PowerActionSleep:
+	case PowerActionHibernate:
+		Policy->Action = (POWER_ACTION)ItemData;
+		Policy->EventCode = 0;
+		break;
+	default:
+		return FALSE;
+	}
+	Policy->Flags = (POWER_ACTION_UI_ALLOWED | POWER_ACTION_QUERY_ALLOWED);
+
+	return TRUE;
+}
+
+
+
+
+//-------------------------------------------------------------------
+
+void ShowCurrentPowerActionPolicies(HWND hwndDlg)
+{
+	TCHAR szAction[MAX_PATH];
+
+	if (!IsBatteryUsed())
+	{
+#if 0
+		/* expiremental code */
+//		ShowCurrentPowerButtonAcAction(hList2, 
+		ShowCurrentPowerActionPolicy(GetDlgItem(hwndDlg, IDC_POWERBUTTON), 
+									   g_SystemBatteries, 
+									   sizeof(g_SystemBatteries) / sizeof(POWER_ACTION),
+									   &gGPP.user.LidCloseAc);
+#else
+		if (LoadString(hApplet, IDS_PowerActionNone1+gGPP.user.LidCloseAc.Action, szAction, MAX_PATH))
+		{
+			SendMessage(GetDlgItem(hwndDlg, IDC_LIDCLOSE),
+						 CB_SELECTSTRING,
+						 TRUE,
+						 (LPARAM)szAction);
+		}
+#endif
+		ShowCurrentPowerActionPolicy(GetDlgItem(hwndDlg, IDC_POWERBUTTON), 
+									   g_PowerButton, 
+									   sizeof(g_PowerButton) / sizeof(POWER_ACTION),
+									   &gGPP.user.PowerButtonAc);
+
+#if 0
+			/* expiremental code */
+		ShowCurrentPowerActionPolicy(GetDlgItem(hwndDlg, IDC_SLEEPBUTTON), 
+									   g_SleepButton, 
+									   sizeof(g_SleepButton) / sizeof(POWER_ACTION),
+									   &gGPP.user.SleepButtonAc);
+#else
+		if (LoadString(hApplet, IDS_PowerActionNone1+gGPP.user.SleepButtonAc.Action, szAction, MAX_PATH))
+		{
+			SendMessage(GetDlgItem(hwndDlg, IDC_SLEEPBUTTON),
+						 CB_SELECTSTRING,
+						 TRUE,
+						 (LPARAM)szAction);
+		}
+#endif
+	}
+	else
+	{
+#if 0
+
+		ShowCurrentPowerActionPolicy(GetDlgItem(hwndDlg, IDC_LIDCLOSE), 
+									   g_SleepButton, 
+									   sizeof(g_SleepButton) / sizeof(POWER_ACTION),
+									   &gGPP.user.LidCloseDc);
+
+		ShowCurrentPowerActionPolicy(GetDlgItem(hwndDlg, IDC_POWERBUTTON), 
+									   g_SleepButton, 
+									   sizeof(g_SleepButton) / sizeof(POWER_ACTION),
+									   &gGPP.user.PowerButtonDc);
+
+		ShowCurrentPowerActionPolicy(GetDlgItem(hwndDlg, IDC_SLEEPBUTTON), 
+									   g_SleepButton, 
+									   sizeof(g_SleepButton) / sizeof(POWER_ACTION),
+									   &gGPP.user.SleepButtonDc);
+#else
+		if (LoadString(hApplet, IDS_PowerActionNone1+gGPP.user.LidCloseDc.Action, szAction, MAX_PATH))
+		{
+			SendMessage(GetDlgItem(hwndDlg, IDC_LIDCLOSE),
+						 CB_SELECTSTRING,
+						 TRUE,
+						 (LPARAM)szAction);
+		}
+		if (LoadString(hApplet, IDS_PowerActionNone1+gGPP.user.PowerButtonDc.Action, szAction, MAX_PATH))
+		{
+			SendMessage(GetDlgItem(hwndDlg, IDC_POWERBUTTON),
+					 	 CB_SELECTSTRING,
+						 TRUE,
+						 (LPARAM)szAction);
+		}
+		if (LoadString(hApplet, IDS_PowerActionNone1+gGPP.user.SleepButtonDc.Action, szAction, MAX_PATH))
+		{
+			SendMessage(GetDlgItem(hwndDlg, IDC_SLEEPBUTTON),
+						 CB_SELECTSTRING,
+						 TRUE,
+						 (LPARAM)szAction);
+		}
+#endif	
+	}
+}
+
+void Adv_InitDialog()
+{
+	HWND hList1;
+	HWND hList2;
+	HWND hList3;
+
+	BOOLEAN bSuspend = FALSE;
+	BOOLEAN bHibernate;
+	BOOLEAN bShutdown;
+
+	SYSTEM_POWER_CAPABILITIES spc;
+
+	SendMessage(GetDlgItem(hAdv, IDC_SYSTRAYBATTERYMETER),
+		BM_SETCHECK,
+		(gGPP.user.GlobalFlags & EnableSysTrayBatteryMeter ? BST_CHECKED : BST_UNCHECKED),
+		(LPARAM)0);
+	SendMessage(GetDlgItem(hAdv, IDC_PASSWORDLOGON),
+		BM_SETCHECK,
+		(gGPP.user.GlobalFlags & EnablePasswordLogon ? BST_CHECKED : BST_UNCHECKED),
+		(LPARAM)0);
+	SendMessage(GetDlgItem(hAdv, IDC_VIDEODIMDISPLAY),
+		BM_SETCHECK,
+		(gGPP.user.GlobalFlags & EnableVideoDimDisplay ? BST_CHECKED : BST_UNCHECKED),
+		(LPARAM)0);
+
+	GetPwrCapabilities(&spc);
+
+	if (spc.SystemS1 || spc.SystemS2 || spc.SystemS3)
+		bSuspend=TRUE;
+
+	bHibernate = spc.HiberFilePresent;
+	bShutdown = spc.SystemS5;
+
+	hList1 = GetDlgItem(hAdv, IDC_LIDCLOSE);
+	SendMessage(hList1, CB_RESETCONTENT, 0, 0);
+
+	memset(g_SystemBatteries, 0x0, sizeof(g_SystemBatteries)); 
+	if (spc.SystemBatteriesPresent)
+	{
+		AddItem(hList1, IDS_PowerActionNone1, (LPARAM)PowerActionNone, g_SystemBatteries);
+
+		if (bSuspend)
+		{
+			AddItem(hList1, IDS_PowerActionSleep, (LPARAM)PowerActionSleep, g_SystemBatteries);
+		}
+
+		if (bHibernate)
+		{
+			AddItem(hList1, IDS_PowerActionHibernate, (LPARAM)PowerActionHibernate, g_SystemBatteries);
+		}
+	}
+	else
+	{
+		ShowWindow(GetDlgItem(hAdv, IDC_SLIDCLOSE), FALSE);
+		ShowWindow(hList1, FALSE);
+	}
+
+	hList2 = GetDlgItem(hAdv, IDC_POWERBUTTON);
+	SendMessage(hList2, CB_RESETCONTENT, 0, 0);
+
+	memset(g_PowerButton, 0x0, sizeof(g_PowerButton));
+	if (spc.PowerButtonPresent)
+	{
+		AddItem(hList2, IDS_PowerActionNone1, (LPARAM)PowerActionNone, g_PowerButton);
+		AddItem(hList2, IDS_PowerActionWarmEject, (LPARAM)PowerActionWarmEject, g_PowerButton);
+
+		if (bSuspend)
+		{
+			AddItem(hList2, IDS_PowerActionSleep, (LPARAM)PowerActionSleep, g_PowerButton);
+		}
+
+		if (bHibernate)
+		{
+			AddItem(hList2, IDS_PowerActionHibernate, (LPARAM)PowerActionHibernate, g_PowerButton);
+
+		}
+		if (bShutdown)
+		{
+			AddItem(hList2, IDS_PowerActionShutdown, (LPARAM)PowerActionShutdown, g_PowerButton);
+		}
+	}
+	else
+	{
+		ShowWindow(GetDlgItem(hAdv, IDC_SPOWERBUTTON), FALSE);
+		ShowWindow(hList2, FALSE);
+	}
+
+	hList3=GetDlgItem(hAdv, IDC_SLEEPBUTTON);
+	SendMessage(hList3, CB_RESETCONTENT, 0, 0);
+    memset(g_SleepButton, 0x0, sizeof(g_SleepButton));
+
+	if (spc.SleepButtonPresent)
+	{
+		AddItem(hList3, IDS_PowerActionNone1, (LPARAM)PowerActionNone, g_SleepButton);
+		AddItem(hList3, IDS_PowerActionWarmEject, (LPARAM)PowerActionWarmEject, g_SleepButton);
+		
+		if (bSuspend)
+		{
+			AddItem(hList3, IDS_PowerActionSleep, (LPARAM)PowerActionSleep, g_SleepButton);
+		}
+
+		if (bHibernate)
+		{
+			AddItem(hList3, IDS_PowerActionHibernate, (LPARAM)PowerActionHibernate, g_SleepButton);
+		}
+
+		if (bShutdown)
+		{
+			AddItem(hList3, IDS_PowerActionShutdown, (LPARAM)PowerActionShutdown, g_SleepButton);
+		}
+	}
+	else
+	{
+		ShowWindow(GetDlgItem(hAdv, IDC_SSLEEPBUTTON), FALSE);
+		ShowWindow(hList3, FALSE);
+	}
+
+	if (ReadGlobalPwrPolicy(&gGPP))
+	{
+		ShowCurrentPowerActionPolicies(hAdv);
+	}
+}
+
+
+void Adv_SaveData(HWND hwndDlg)
+{
+	BOOLEAN bSystrayBatteryMeter;
+	BOOLEAN bPasswordLogon;
+	BOOLEAN bVideoDimDisplay;
+
+	bSystrayBatteryMeter = (BOOLEAN)SendMessage(GetDlgItem(hwndDlg, IDC_SYSTRAYBATTERYMETER),
+		BM_GETCHECK,
+		(WPARAM)0,
+		(LPARAM)0);
+	bPasswordLogon = (BOOLEAN)SendMessage(GetDlgItem(hwndDlg, IDC_PASSWORDLOGON),
+		BM_GETCHECK,
+		(WPARAM)0,
+		(LPARAM)0);
+	bVideoDimDisplay = (BOOLEAN)SendMessage(GetDlgItem(hwndDlg, IDC_VIDEODIMDISPLAY),
+		BM_GETCHECK,
+		(WPARAM)0,
+		(LPARAM)0);
+    
+	if (bSystrayBatteryMeter)
+	{
+		if (!(gGPP.user.GlobalFlags & EnableSysTrayBatteryMeter))
+		{
+			gGPP.user.GlobalFlags = gGPP.user.GlobalFlags + EnableSysTrayBatteryMeter;
+		}
+	}
+	else
+	{
+		if ((gGPP.user.GlobalFlags & EnableSysTrayBatteryMeter))
+		{
+			gGPP.user.GlobalFlags = gGPP.user.GlobalFlags - EnableSysTrayBatteryMeter;
+		}
+	}
+	if (bPasswordLogon)
+	{
+		if (!(gGPP.user.GlobalFlags & EnablePasswordLogon))
+		{
+			gGPP.user.GlobalFlags = gGPP.user.GlobalFlags + EnablePasswordLogon;
+		}
+	}
+	else
+	{
+		if ((gGPP.user.GlobalFlags & EnablePasswordLogon))
+		{
+			gGPP.user.GlobalFlags = gGPP.user.GlobalFlags - EnablePasswordLogon;
+		}
+	}
+	if (bVideoDimDisplay)
+	{
+		if (!(gGPP.user.GlobalFlags & EnableVideoDimDisplay))
+		{
+			gGPP.user.GlobalFlags = gGPP.user.GlobalFlags + EnableVideoDimDisplay;
+		}
+	}
+	else
+	{
+		if ((gGPP.user.GlobalFlags & EnableVideoDimDisplay))
+		{
+			gGPP.user.GlobalFlags = gGPP.user.GlobalFlags - EnableVideoDimDisplay;
+		}
+	}
+	if (!IsBatteryUsed())
+	{
+		SaveCurrentPowerActionPolicy(GetDlgItem(hwndDlg, IDC_POWERBUTTON), &gGPP.user.PowerButtonAc);
+#if 0
+		SaveCurrentPowerActionPolicy(GetDlgItem(hwndDlg, IDC_LIDCLOSE), &gGPP.user.LidCloseAc);
+		SaveCurrentPowerActionPolicy(GetDlgItem(hwndDlg, IDC_SLEEPBUTTON), &gGPP.user.SleepButtonAc);
+#endif
+	}
+	else
+	{
+#if 0
+		SaveCurrentPowerActionPolicy(GetDlgItem(hwndDlg, IDC_POWERBUTTON), &gGPP.user.PowerButtonDc);
+		SaveCurrentPowerActionPolicy(GetDlgItem(hwndDlg, IDC_LIDCLOSE), &gGPP.user.LidCloseDc);
+		SaveCurrentPowerActionPolicy(GetDlgItem(hwndDlg, IDC_SLEEPBUTTON), &gGPP.user.SleepButtonDc);
+#endif
+	}
+
+	if (!WriteGlobalPwrPolicy(&gGPP))
+	{
+		MessageBox(hwndDlg, L"WriteGlobalPwrPolicy failed", NULL, MB_OK);
+	}
+
+	Adv_InitDialog(hwndDlg);
+}

Added: trunk/reactos/dll/cpl/powercfg/alarms.c
URL: http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/cpl/powercfg/alarms.c?rev=22362&view=auto
==============================================================================
--- trunk/reactos/dll/cpl/powercfg/alarms.c (added)
+++ trunk/reactos/dll/cpl/powercfg/alarms.c Thu Jun 15 18:07:08 2006
@@ -1,0 +1,200 @@
+/* $Id: alarms.c 21500 2006-04-07 10:20:39Z janderwald $
+ *
+ * PROJECT:         ReactOS Power Configuration Applet
+ * LICENSE:         GPL - See COPYING in the top level directory
+ * FILE:            dll/cpl/powercfg/alarms.c
+ * PURPOSE:         alarms tab of applet
+ * PROGRAMMERS:     Alexander Wurzinger (Lohnegrim at gmx dot net)
+ *                  Johannes Anderwald (johannes.anderwald at student.tugraz.at)
+ *                  Martin Rottensteiner
+ */
+
+
+#include <windows.h>
+#include <commctrl.h>
+#include <cpl.h>
+#include <stdio.h>
+
+#include "resource.h"
+#include "powercfg.h"
+#include "powrprof.h"
+
+BOOLEAN Ala_InitData(HWND);
+
+/* Property page dialog callback */
+INT_PTR CALLBACK
+alarmsProc(
+  HWND hwndDlg,
+  UINT uMsg,
+  WPARAM wParam,
+  LPARAM lParam
+)
+{
+  switch(uMsg)
+  {
+    case WM_INITDIALOG:
+		if (!Ala_InitData(hwndDlg))
+		{
+			//TODO
+			//handle initialization error
+		}
+		return TRUE;
+	default:
+		break;
+  }
+  return FALSE;
+}
+
+BOOLEAN Ala_InitData(HWND hwndDlg)
+{
+	TCHAR szAction[MAX_PATH];
+	TCHAR szText[MAX_PATH];
+	TCHAR szSound[MAX_PATH];
+	TCHAR szMessage[MAX_PATH];
+	TCHAR szTemp[MAX_PATH];
+	TCHAR szBatteryLevel[MAX_PATH];
+	TCHAR szProgram[MAX_PATH];
+
+	if (!ReadGlobalPwrPolicy(&gGPP))
+	{
+		return FALSE;
+	}
+
+	if (gGPP.user.DischargePolicy[DISCHARGE_POLICY_LOW].Enable)
+	{
+		SendMessage(GetDlgItem(hwndDlg, IDC_ALARM1),
+			BM_SETCHECK,
+			(gGPP.user.DischargePolicy[DISCHARGE_POLICY_LOW].Enable ? BST_CHECKED : BST_UNCHECKED),
+			(LPARAM)0);
+		
+		if (LoadString(hApplet, IDS_PROCENT, szTemp, MAX_PATH))
+		{
+			swprintf(szBatteryLevel,szTemp,gGPP.user.DischargePolicy[DISCHARGE_POLICY_LOW].BatteryLevel);
+			SetWindowText(GetDlgItem(hwndDlg, IDC_ALARMVALUE1),szBatteryLevel);
+		}
+
+		SendMessageW(GetDlgItem(hwndDlg, IDC_ALARMBAR1),
+			TBM_SETRANGE,
+			(WPARAM)TRUE,
+			(LPARAM)MAKELONG(0, 100));
+		SendMessageW(GetDlgItem(hwndDlg, IDC_ALARMBAR1),
+			TBM_SETTICFREQ,
+			(WPARAM)TRUE,
+			(LPARAM)20);
+		SendMessageW(GetDlgItem(hwndDlg, IDC_ALARMBAR1),
+			TBM_SETPOS,
+			(WPARAM)TRUE,
+			(LPARAM)gGPP.user.DischargePolicy[DISCHARGE_POLICY_LOW].BatteryLevel);
+		
+		if (LoadString(hApplet, gGPP.user.DischargePolicy[DISCHARGE_POLICY_LOW].PowerPolicy.Action+IDS_PowerActionNone1, szAction, MAX_PATH))
+		{
+			SetWindowText(GetDlgItem(hwndDlg, IDC_ALARMAKTION1),szAction);
+		}
+
+		memset(szMessage, 0x0, sizeof(szMessage));
+		LoadString(hApplet, IDS_NOACTION, szMessage, MAX_PATH);
+						
+		if (LOWORD(gGPP.user.DischargePolicy[DISCHARGE_POLICY_LOW].PowerPolicy.EventCode) & POWER_LEVEL_USER_NOTIFY_TEXT)
+		{
+			if (LOWORD(gGPP.user.DischargePolicy[DISCHARGE_POLICY_LOW].PowerPolicy.EventCode) & POWER_LEVEL_USER_NOTIFY_SOUND)
+			{	
+				if (LoadString(hApplet, IDS_SOUND, szSound, MAX_PATH) && LoadString(hApplet, IDS_TEXT, szText, MAX_PATH))
+				{
+					swprintf(szMessage,L"%s, %s",szSound,szText);
+				}
+			}
+			else
+			{
+				if (LoadString(hApplet, IDS_TEXT, szText, MAX_PATH))
+				{
+					swprintf(szMessage,L"%s",szText);
+				}
+			}
+		}
+		else
+		{
+			if (LOWORD(gGPP.user.DischargePolicy[DISCHARGE_POLICY_LOW].PowerPolicy.EventCode) & POWER_LEVEL_USER_NOTIFY_SOUND)
+			{
+				if (LoadString(hApplet, IDS_SOUND, szSound, MAX_PATH))
+				{
+					swprintf(szMessage,L"%s",szSound);
+				}
+			}
+		}
+
+		SetWindowText(GetDlgItem(hwndDlg, IDC_ALARMMSG1),szMessage);
+		
+		if (LoadString(hApplet, IDS_PowerActionNone2, szProgram, MAX_PATH))
+		{
+			SetWindowText(GetDlgItem(hwndDlg, IDC_ALARMPROG1),szProgram);
+		}
+	}
+	if (gGPP.user.DischargePolicy[DISCHARGE_POLICY_CRITICAL].Enable)
+	{
+		SendMessageW(GetDlgItem(hwndDlg, IDC_ALARM2),
+			BM_SETCHECK,
+			(gGPP.user.DischargePolicy[DISCHARGE_POLICY_CRITICAL].Enable ? BST_CHECKED : BST_UNCHECKED),
+			(LPARAM)0);
+		if (LoadString(hApplet, IDS_PROCENT, szTemp, MAX_PATH))
+		{
+			swprintf(szBatteryLevel,szTemp,gGPP.user.DischargePolicy[DISCHARGE_POLICY_CRITICAL].BatteryLevel);
+			SetWindowText(GetDlgItem(hwndDlg, IDC_ALARMVALUE2),szBatteryLevel);
+		}
+
+		SendMessageW(GetDlgItem(hwndDlg, IDC_ALARMBAR2),
+			TBM_SETRANGE,
+			(WPARAM)TRUE,
+			(LPARAM)MAKELONG(0, 100));
+		SendMessageW(GetDlgItem(hwndDlg, IDC_ALARMBAR2),
+			TBM_SETPOS,
+			(WPARAM)TRUE,
+			(LPARAM)gGPP.user.DischargePolicy[DISCHARGE_POLICY_CRITICAL].BatteryLevel);
+
+		if (LoadString(hApplet, gGPP.user.DischargePolicy[DISCHARGE_POLICY_CRITICAL].PowerPolicy.Action+IDS_PowerActionNone1, szAction, MAX_PATH))
+		{
+			SendMessageW(GetDlgItem(hwndDlg, IDC_ALARMAKTION2),
+									WM_SETTEXT,
+									(WPARAM)0,
+									(LPARAM)szAction);
+		}
+
+		memset(szMessage, 0x0, sizeof(szMessage));
+		LoadString(hApplet, IDS_NOACTION, szMessage, MAX_PATH);
+		
+		if (LOWORD(gGPP.user.DischargePolicy[DISCHARGE_POLICY_CRITICAL].PowerPolicy.EventCode) & POWER_LEVEL_USER_NOTIFY_TEXT)
+		{
+			if (LOWORD(gGPP.user.DischargePolicy[DISCHARGE_POLICY_CRITICAL].PowerPolicy.EventCode) & POWER_LEVEL_USER_NOTIFY_SOUND)
+			{
+				if (LoadString(hApplet, IDS_TEXT, szText, MAX_PATH) && LoadString(hApplet, IDS_SOUND, szSound, MAX_PATH))
+				{
+					swprintf(szMessage,L"%s, %s",szSound,szText);
+				}
+			}
+			else
+			{
+				if (LoadString(hApplet, IDS_TEXT, szText, MAX_PATH))
+				{
+					swprintf(szMessage,L"%s",szText);
+				}
+			}
+		}
+		else
+		{
+			if (LOWORD(gGPP.user.DischargePolicy[DISCHARGE_POLICY_CRITICAL].PowerPolicy.EventCode) & POWER_LEVEL_USER_NOTIFY_SOUND)
+			{
+				if (LoadString(hApplet, IDS_SOUND, szSound, MAX_PATH))
+				{
+					swprintf(szMessage,L"%s",szSound);
+				}
+			}
+		}
+
+		SetWindowText(GetDlgItem(hwndDlg, IDC_ALARMMSG2),szMessage);
+		
+		if (LoadString(hApplet, IDS_PowerActionNone2, szProgram, MAX_PATH))
+		{
+			SetWindowText(GetDlgItem(hwndDlg, IDC_ALARMPROG2),szProgram);
+		}
+	}
+	return TRUE;
+}

Added: trunk/reactos/dll/cpl/powercfg/de.rc
URL: http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/cpl/powercfg/de.rc?rev=22362&view=auto
==============================================================================
--- trunk/reactos/dll/cpl/powercfg/de.rc (added)
+++ trunk/reactos/dll/cpl/powercfg/de.rc Thu Jun 15 18:07:08 2006
@@ -1,0 +1,162 @@
+// German (De) resources by Lohegrim (Lohnegrim at gmx dot net)
+
+LANGUAGE LANG_GERMAN, SUBLANG_NEUTRAL
+
+IDD_PROPPAGEPOWERSHEMES DIALOGEX 0, 0, 252, 218
+STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION
+CAPTION "Energieschemas"
+FONT 8, "MS Shell Dlg"
+BEGIN
+  ICON IDI_ACDC, IDI_ACDC, 7,7,28,22
+  LTEXT "Wählen Sie das Energieschema mit den am besten zu diesem Computer passenden Einstellungen. Bedenken Sie, dass die Einstellungen das unten ausgewählte Schema modifizieren.",
+	-1,45,13,194,36
+  GROUPBOX "&Energieschemen", -1, 7,57,240,46
+  COMBOBOX IDC_ENERGYLIST, 14,70,224,92, CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
+  PUSHBUTTON "Speichern &unter...", -1, 100,85,75,15,WS_DISABLED
+  PUSHBUTTON "&Löschen", -1, 180,85,55,15,WS_DISABLED
+  GROUPBOX "Unbekannt", IDC_GRPDETAIL, 7,108,240,105
+  LTEXT "Bei:",IDC_SAT,15,120,60,10
+  LTEXT "Netzbetrieb",IDC_SAC,100,120,45,15
+  ICON IDI_AC, IDC_IAC, 75,115,25,15
+  LTEXT "Batteriebetrieb",IDC_SDC,197,120,45,15
+  ICON IDI_DC, IDC_IDC, 165,115,25,15
+  LTEXT "&Monitor ausschalten:",IDC_MONITOR,15,145,80,10
+  COMBOBOX IDC_MONITORACLIST, 100,140,65,150, CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
+  COMBOBOX IDC_MONITORDCLIST, 175,140,65,150, CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
+  LTEXT "&Festplatten ausschalten:",IDC_DISK,15,160,80,10
+  COMBOBOX IDC_DISKACLIST, 100,155,65,150, CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
+  COMBOBOX IDC_DISKDCLIST, 175,155,65,150, CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
+  LTEXT "&Standby:",IDC_STANDBY,15,180,55,10
+  COMBOBOX IDC_STANDBYACLIST, 100,175,65,150, CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
+  COMBOBOX IDC_STANDBYDCLIST, 175,175,65,150, CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
+  LTEXT "&Ruhezustand:",IDC_HYBERNATE,15,195,55,10
+  COMBOBOX IDC_HYBERNATEACLIST, 100,190,65,150, CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
+  COMBOBOX IDC_HYBERNATEDCLIST, 175,190,65,150, CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
+END
+
+IDD_PROPPAGEALARMS DIALOG DISCARDABLE  0, 0, 250, 220
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Alarme"
+FONT 8, "MS Shell Dlg"
+BEGIN
+    GROUPBOX        "Alarm bei niedrigem Batteriestand",-1,10,15,235,95
+    CONTROL         "Alarm bei folgendem &Energiestand auslösen:",IDC_ALARM1,
+                    "Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,25,180,15
+    LTEXT           "Unbekannt",IDC_ALARMVALUE1,200,25,40,10
+    LTEXT           "0%",-1,20,40,15,15
+    CONTROL         "Slider1",IDC_ALARMBAR1,"msctls_trackbar32",TBS_HORZ | 
+                    TBS_AUTOTICKS | WS_TABSTOP,30,40,170,15
+    LTEXT           "100%",-1,215,40,25,10
+    PUSHBUTTON      "Alar&m Action...",-1,20,70,70,15,WS_DISABLED
+    LTEXT           "Benachrichtigung:",-1,95,70,50,10
+    LTEXT           "Unbekannt",IDC_ALARMMSG1,145,70,95,10
+    LTEXT           "Aktion:",-1,95,80,45,10
+    LTEXT           "Unbekannt",IDC_ALARMAKTION1,145,80,95,10
+    LTEXT           "Ausführen:",-1,95,90,50,10
+    LTEXT           "Unbekannt",IDC_ALARMPROG1,150,90,40,10
+
+    GROUPBOX        "Alarm bei kritischem Batteriestand",-1,10,115,235,95
+    CONTROL         "Alarm bei folgendem &Energiestand auslösen:",IDC_ALARM2,
+                    "Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,125,180,15
+    LTEXT           "Unbekannt",IDC_ALARMVALUE2,200,125,40,10
+    LTEXT           "0%",-1,20,140,15,15
+    CONTROL         "Slider1",IDC_ALARMBAR2,"msctls_trackbar32",TBS_HORZ | 
+                    TBS_AUTOTICKS | WS_TABSTOP,30,140,170,15
+    LTEXT           "100%",-1,215,140,25,10
+    PUSHBUTTON      "Alar&m Action...",-1,20,170,70,15,WS_DISABLED
+    LTEXT           "Benachrichtigung:",-1,95,170,50,10
+    LTEXT           "Unbekannt",IDC_ALARMMSG2,145,170,95,10
+    LTEXT           "Aktion:",-1,95,180,45,10
+    LTEXT           "Unbekannt",IDC_ALARMAKTION2,145,180,95,10
+    LTEXT           "Ausführen:",-1,95,190,50,10
+    LTEXT           "Unbekannt",IDC_ALARMPROG2,150,190,40,10
+END
+
+IDD_PROPPAGEADVANCED DIALOG DISCARDABLE  0, 0, 250, 220
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Erweitert"
+FONT 8, "MS Shell Dlg"
+BEGIN
+    ICON            IDI_ACDC,IDI_ACDC,5,5,20,20
+    LTEXT           "Wählen Sie die Energiesparoptionen aus, die Sie verwenden möchten.",-1,30,5,205,20
+    GROUPBOX        "Optionen",-1,5,35,225,55
+    CONTROL         "&Symbol in der Taskleiste anzeigen",IDC_SYSTRAYBATTERYMETER,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,15,45,200,10
+    CONTROL         "&Kennwort beim Reaktivieren aus dem Standbymodus anfordern",IDC_PASSWORDLOGON,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,15,55,200,10
+    CONTROL         "&Helligkeit der Anzeige beim Batteriebetrieb verringern",IDC_VIDEODIMDISPLAY,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,15,65,200,10
+    GROUPBOX        "Netzschaltervorgänge",-1,5,100,230,105
+    LTEXT           "Beim Schließen des &Laptops:", IDC_SLIDCLOSE,10,110,210,10
+    COMBOBOX        IDC_LIDCLOSE,10,120,220,90,CBS_DROPDOWNLIST | CBS_SORT | 
+                    WS_VSCROLL | WS_TABSTOP
+    LTEXT           "Beim Drücken des &Netzschalters am Computer:", IDC_SPOWERBUTTON,10,135,210,10
+    COMBOBOX        IDC_POWERBUTTON,10,150,220,90,CBS_DROPDOWNLIST | CBS_SORT | 
+                    WS_VSCROLL | WS_TABSTOP
+    LTEXT           "Beim Drücken des Schalters für den &Ruhezustand am Computer:", IDC_SSLEEPBUTTON,10,165,210,10
+    COMBOBOX        IDC_SLEEPBUTTON,10,180,220,90,CBS_DROPDOWNLIST | CBS_SORT | 
+                    WS_VSCROLL | WS_TABSTOP
+END
+
+IDD_PROPPAGEHIBERNATE DIALOG DISCARDABLE  0, 0, 250, 220
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Ruhezustand"
+FONT 8, "MS Shell Dlg"
+BEGIN
+    ICON            IDI_SCREEN,IDI_SCREEN,5,5,20,20
+    LTEXT           "Wenn der Computer in den Ruhezustand wechselt, wird der Inhalt des Arbeitsspeichers gespeichert und der Computer heruntergefahren. Wenn er wieder gestartet wird, kehrt er zum vorherigen Zustand zurück.",
+                    -1,35,5,195,35
+    GROUPBOX        "Ruhezustand",-1,5,45,235,25
+    CONTROL         "&Ruhezustand aktivieren",IDC_HIBERNATEFILE,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,10,55,210,10
+    GROUPBOX        "Speicherplatz für den Ruhezustand",-1,5,80,240,60
+    LTEXT           "Freier Speicherplatz:",-1,10,90,100,10
+    LTEXT           "Unbekannt",IDC_FREESPACE,120,90,70,10
+    LTEXT           "Für Ruhezustand benötigt:",-1,10,100,115,10
+    LTEXT           "Unbekannt",IDC_SPACEFORHIBERNATEFILE,120,100,55,10
+    LTEXT           "Geben Sie Speicherplatz frei, bevor Sie den Computer in den Ruhezustand versetzen.",IDC_TOLESSFREESPACE,10,115,220,20
+END
+
+STRINGTABLE
+BEGIN
+  IDS_CPLNAME_1 "Energieoptionen"
+  IDS_CPLDESCRIPTION_1 "Konfiguriert die Energiespareinstellungen für den Computer."
+  IDS_PROCENT "%i%%"
+  IDS_SOUND "Sound"
+  IDS_TEXT "Text"
+  IDS_CONFIG1 "Einstellungen für Energieschema %s."
+  IDS_CONFIG2 "Erweiterte Einstellungen für %s."
+
+  IDS_SIZEBYTS "%i Bytes"
+  IDS_SIZEMB "%i MB"
+
+  IDS_NOACTION "Nichts unternehmen"
+
+  IDS_PowerActionNone1 "Keine Aktion"
+  IDS_PowerActionUnknown "Unbekannt"
+  IDS_PowerActionSleep "In den Standbymodus wechseln"
+  IDS_PowerActionHibernate "In den Ruhezustand wechseln"
+  IDS_PowerActionShutdown "Computer herunterfahren"
+  IDS_PowerActionRestart "Computer neu starten"
+  IDS_PowerActionShutdownOff "Computer ausschalten"
+  IDS_PowerActionWarmEject "Zur Vorgangsauswahl auffordern"
+  IDS_PowerActionNone2 "Kein"
+
+  IDS_TIMEOUT1 "Nach 1 Min."
+  IDS_TIMEOUT2 "Nach 2 Min."
+  IDS_TIMEOUT3 "Nach 3 Min."
+  IDS_TIMEOUT4 "Nach 5 Min."
+  IDS_TIMEOUT5 "Nach 10 Min."
+  IDS_TIMEOUT6 "Nach 15 Min."
+  IDS_TIMEOUT7 "Nach 20 Min."
+  IDS_TIMEOUT8 "Nach 25 Min."
+  IDS_TIMEOUT9 "Nach 30 Min."
+  IDS_TIMEOUT10 "Nach 45 Min."
+  IDS_TIMEOUT11 "Nach 1 Stunde"
+  IDS_TIMEOUT12 "Nach 2 Stunden"
+  IDS_TIMEOUT13 "Nach 3 Stunden"
+  IDS_TIMEOUT14 "Nach 4 Stunden"
+  IDS_TIMEOUT15 "Nach 5 Stunden"
+  IDS_TIMEOUT16 "Nie"
+
+END

Added: trunk/reactos/dll/cpl/powercfg/en.rc
URL: http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/cpl/powercfg/en.rc?rev=22362&view=auto
==============================================================================
--- trunk/reactos/dll/cpl/powercfg/en.rc (added)
+++ trunk/reactos/dll/cpl/powercfg/en.rc Thu Jun 15 18:07:08 2006
@@ -1,0 +1,162 @@
+// English (en) resources by Lohegrim (Lohnegrim at gmx dot net)
+
+LANGUAGE LANG_ENGLISH, SUBLANG_NEUTRAL
+
+IDD_PROPPAGEPOWERSHEMES DIALOGEX 0, 0, 250, 220
+STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION
+CAPTION "Power Schemes"
+FONT 8, "MS Shell Dlg"
+BEGIN
+  ICON IDI_ACDC, IDI_ACDC, 7,7,28,22
+  LTEXT "Select the power scheme with the most appropriate settings for this computer. Note that changing the settings below will modify the selected scheme.",
+	-1,45,13,194,36
+  GROUPBOX "P&ower schemes", -1, 7,57,240,46
+  COMBOBOX IDC_ENERGYLIST, 14,70,224,92, CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
+  PUSHBUTTON "&Save As...", -1, 100,85,75,15,WS_DISABLED
+  PUSHBUTTON "&Delete", -1, 180,85,55,15,WS_DISABLED
+  GROUPBOX "Unknown", IDC_GRPDETAIL, 7,108,240,105
+  LTEXT "When computer is:",IDC_SAT,15,120,60,10
+  LTEXT "Plugged in",IDC_SAC,100,120,45,15
+  ICON IDI_AC, IDC_IAC, 75,115,25,15
+  LTEXT "Running on batteries",IDC_SDC,197,120,45,15
+  ICON IDI_DC, IDC_IDC, 165,115,25,15
+  LTEXT "Turn off &monitor:",IDC_MONITOR,15,145,80,10
+  COMBOBOX IDC_MONITORACLIST, 100,140,65,150, CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
+  COMBOBOX IDC_MONITORDCLIST, 175,140,65,150, CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
+  LTEXT "Turn off hard d&isks:",IDC_DISK,15,160,80,10
+  COMBOBOX IDC_DISKACLIST, 100,155,65,150, CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
+  COMBOBOX IDC_DISKDCLIST, 175,155,65,150, CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
+  LTEXT "System s&tandby:",IDC_STANDBY,15,180,80,10
+  COMBOBOX IDC_STANDBYACLIST, 100,175,65,150, CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
+  COMBOBOX IDC_STANDBYDCLIST, 175,175,65,150, CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
+  LTEXT "System &hibernates:",IDC_HYBERNATE,15,195,80,10
+  COMBOBOX IDC_HYBERNATEACLIST, 100,190,65,150, CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
+  COMBOBOX IDC_HYBERNATEDCLIST, 175,190,65,150, CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
+END
+
+IDD_PROPPAGEALARMS DIALOG DISCARDABLE  0, 0, 250, 220
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Alarms"
+FONT 8, "MS Sans Serif"
+BEGIN
+    GROUPBOX        "Low battery alarm",-1,10,15,235,95
+    CONTROL         "Activate &low battery alarm when power level reaches:",IDC_ALARM1,
+                    "Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,25,180,15
+    LTEXT           "unknown",IDC_ALARMVALUE1,200,25,40,10
+    LTEXT           "0%",-1,20,40,15,15
+    CONTROL         "Slider1",IDC_ALARMBAR1,"msctls_trackbar32",TBS_HORZ | 
+                    TBS_AUTOTICKS | WS_TABSTOP,30,40,170,15
+    LTEXT           "100%",-1,215,40,25,10
+    PUSHBUTTON      "Alar&m Action...",-1,20,70,70,15,WS_DISABLED
+    LTEXT           "Notification:",-1,95,70,50,10
+    LTEXT           "Unknown",IDC_ALARMMSG1,145,70,95,10
+    LTEXT           "Action:",-1,95,80,45,10
+    LTEXT           "Unknown",IDC_ALARMAKTION1,145,80,95,10
+    LTEXT           "Run Program:",-1,95,90,50,10
+    LTEXT           "Unknown",IDC_ALARMPROG1,150,90,40,10
+
+    GROUPBOX        "Critical battery alarm",-1,10,115,235,95
+    CONTROL         "Activate &low battery alarm when power level reaches:",IDC_ALARM2,
+                    "Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,125,180,15
+    LTEXT           "unknown",IDC_ALARMVALUE2,200,125,40,10
+    LTEXT           "0%",-1,20,140,15,15
+    CONTROL         "Slider1",IDC_ALARMBAR2,"msctls_trackbar32",TBS_HORZ | 
+                    TBS_AUTOTICKS | WS_TABSTOP,30,140,170,15
+    LTEXT           "100%",-1,215,140,25,10
+    PUSHBUTTON      "Alar&m Action...",-1,20,170,70,15,WS_DISABLED
+    LTEXT           "Notification:",-1,95,170,50,10
+    LTEXT           "Unknown",IDC_ALARMMSG2,145,170,95,10
+    LTEXT           "Action:",-1,95,180,45,10
+    LTEXT           "Unknown",IDC_ALARMAKTION2,145,180,95,10
+    LTEXT           "Run Program:",-1,95,190,50,10
+    LTEXT           "Unknown",IDC_ALARMPROG2,150,190,40,10
+END
+
+IDD_PROPPAGEADVANCED DIALOG DISCARDABLE  0, 0, 250, 220
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Advanced"
+FONT 8, "MS Sans Serif"
+BEGIN
+    ICON            IDI_ACDC,IDI_ACDC,5,5,20,20
+    LTEXT           "Select the power-saving settings you want to use.",-1,30,5,205,20
+    GROUPBOX        "Options",-1,5,35,225,55
+    CONTROL         "Alway&s show icon on the taskbar",IDC_SYSTRAYBATTERYMETER,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,15,45,200,10
+    CONTROL         "&Prompt for password when computer resumes from standby",IDC_PASSWORDLOGON,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,15,55,200,10
+    CONTROL         "&Dim display when running on batteries.",IDC_VIDEODIMDISPLAY,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,15,65,200,10
+    GROUPBOX        "Power buttons",-1,5,100,230,105
+    LTEXT           "&When I close the lid of my portable computer:", IDC_SLIDCLOSE,10,110,210,10
+    COMBOBOX        IDC_LIDCLOSE,10,120,220,90,CBS_DROPDOWNLIST | CBS_SORT | 
+                    WS_VSCROLL | WS_TABSTOP
+    LTEXT           "Wh&en I press the power button on my computer:", IDC_SPOWERBUTTON,10,135,210,10
+    COMBOBOX        IDC_POWERBUTTON,10,150,220,90,CBS_DROPDOWNLIST | CBS_SORT | 
+                    WS_VSCROLL | WS_TABSTOP
+    LTEXT           "Whe&n I press the sleep button on my computer:", IDC_SSLEEPBUTTON,10,165,210,10
+    COMBOBOX        IDC_SLEEPBUTTON,10,180,220,90,CBS_DROPDOWNLIST | CBS_SORT | 
+                    WS_VSCROLL | WS_TABSTOP
+END
+
+IDD_PROPPAGEHIBERNATE DIALOG DISCARDABLE  0, 0, 250, 220
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Hibernate"
+FONT 8, "MS Sans Serif"
+BEGIN
+    ICON            IDI_SCREEN,IDI_SCREEN,5,5,20,20
+    LTEXT           "When your computer hibernates, it stores whatever it has in memory on your hard disk and then shuts down. When your computer comes out of hibernation, it returns to its previous state. ",
+                    -1,35,5,195,35
+    GROUPBOX        "Hibernate",-1,5,45,235,25
+    CONTROL         "Enable &hibernation",IDC_HIBERNATEFILE,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,10,55,210,10
+    GROUPBOX        "Disk space for hibernation",-1,5,80,240,60
+    LTEXT           "Free disk space:",-1,10,90,100,10
+    LTEXT           "Unknown",IDC_FREESPACE,120,90,70,10
+    LTEXT           "Disk space required to hibernate:",-1,10,100,115,10
+    LTEXT           "Unknown",IDC_SPACEFORHIBERNATEFILE,120,100,55,10
+    LTEXT           "You must free some disk space before your computer can hibernate. ",IDC_TOLESSFREESPACE,10,115,220,20
+END
+
+STRINGTABLE
+BEGIN
+  IDS_CPLNAME_1 "Power Options"
+  IDS_CPLDESCRIPTION_1 "Configure energy-saving settings for your computer."
+  IDS_PROCENT "%i%%"
+  IDS_SOUND "Sound"
+  IDS_TEXT "Text"
+  IDS_CONFIG1 "Settings for %1 power scheme"
+  IDS_CONFIG2 "Advanced settings for %1"
+
+  IDS_SIZEBYTS "%i bytes"
+  IDS_SIZEMB "%i MB"
+
+  IDS_NOACTION "Do nothing"
+
+  IDS_PowerActionNone1 "No action"
+  IDS_PowerActionUnknown "Unknown"
+  IDS_PowerActionSleep "Stand by"
+  IDS_PowerActionHibernate "Hibernate"
+  IDS_PowerActionShutdown "Shut down"
+  IDS_PowerActionRestart "Restart"
+  IDS_PowerActionShutdownOff "Shutdown and Turn the Power Off"
+  IDS_PowerActionWarmEject "Ask me what to do"
+  IDS_PowerActionNone2 "None"
+
+  IDS_TIMEOUT1 "After 1 min"
+  IDS_TIMEOUT2 "After 2 mins"
+  IDS_TIMEOUT3 "After 3 mins"
+  IDS_TIMEOUT4 "After 5 mins"
+  IDS_TIMEOUT5 "After 10 mins"
+  IDS_TIMEOUT6 "After 15 mins"
+  IDS_TIMEOUT7 "After 20 mins"
+  IDS_TIMEOUT8 "After 25 mins"
+  IDS_TIMEOUT9 "After 30 mins"
+  IDS_TIMEOUT10 "After 45 mins"
+  IDS_TIMEOUT11 "After 1 hour"
+  IDS_TIMEOUT12 "After 2 hours"
+  IDS_TIMEOUT13 "After 3 hours"
+  IDS_TIMEOUT14 "After 4 hours"
+  IDS_TIMEOUT15 "After 5 hours"
+  IDS_TIMEOUT16 "Never"
+END
+

Added: trunk/reactos/dll/cpl/powercfg/hibernate.c
URL: http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/cpl/powercfg/hibernate.c?rev=22362&view=auto
==============================================================================
--- trunk/reactos/dll/cpl/powercfg/hibernate.c (added)
+++ trunk/reactos/dll/cpl/powercfg/hibernate.c Thu Jun 15 18:07:08 2006
@@ -1,0 +1,167 @@
+/* $Id: hibernate.c 21500 2006-04-07 10:20:39Z janderwald $
+ *
+ * PROJECT:         ReactOS Power Configuration Applet
+ * LICENSE:         GPL - See COPYING in the top level directory
+ * FILE:            dll/cpl/powercfg/hibernate.c
+ * PURPOSE:         hibernate tab of applet
+ * PROGRAMMERS:     Alexander Wurzinger (Lohnegrim at gmx dot net)
+ *                  Johannes Anderwald (johannes.anderwald at student.tugraz.at)
+ *                  Martin Rottensteiner
+ */
+
+#include "ntstatus.h"
+#define WIN32_NO_STATUS
+#include <windows.h>
+#include <commctrl.h>
+#include <cpl.h>
+#include <stdio.h>
+
+#include "resource.h"
+#include "powercfg.h"
+#include "powrprof.h"
+
+void Hib_InitDialog(HWND);
+INT_PTR Hib_SaveData(HWND);
+BOOLEAN Pos_InitData();
+void Adv_InitDialog();
+
+/* Property page dialog callback */
+INT_PTR CALLBACK
+hibernateProc(
+  HWND hwndDlg,
+  UINT uMsg,
+  WPARAM wParam,
+  LPARAM lParam
+)
+{
+  switch(uMsg)
+  {
+    case WM_INITDIALOG:
+		Hib_InitDialog(hwndDlg);
+		return TRUE;
+	case WM_COMMAND:
+		switch(LOWORD(wParam))
+		{
+		case IDC_HIBERNATEFILE:
+			if (HIWORD(wParam) == BN_CLICKED)
+			{
+				PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
+			}
+		}
+		break;
+	case WM_NOTIFY:
+		{
+			LPNMHDR lpnm = (LPNMHDR)lParam;
+			if (lpnm->code == (UINT)PSN_APPLY)
+			{
+				return Hib_SaveData(hwndDlg);
+			}
+		}
+  }
+  return FALSE;
+}
+
+void Hib_InitDialog(HWND hwndDlg)
+{
+	SYSTEM_POWER_CAPABILITIES PowerCaps;
+	MEMORYSTATUSEX msex;
+	WCHAR szSize[MAX_PATH];
+	WCHAR szTemp[MAX_PATH];
+	ULARGE_INTEGER FreeBytesAvailable, TotalNumberOfBytes, TotalNumberOfFreeBytes;
+
+	if (GetPwrCapabilities(&PowerCaps))
+	{
+		if (PowerCaps.HiberFilePresent)
+		{
+			SendMessageW(GetDlgItem(hwndDlg, IDC_HIBERNATEFILE),
+						 BM_SETCHECK,
+						 (WPARAM)BST_CHECKED,
+						 (LPARAM)0);
+		}
+		else
+		{
+			SendMessageW(GetDlgItem(hwndDlg, IDC_HIBERNATEFILE),
+						 BM_SETCHECK,
+						 (WPARAM)BST_UNCHECKED,
+						 (LPARAM)0);
+		}
+
+		msex.dwLength = sizeof(msex);
+		if (!GlobalMemoryStatusEx(&msex))
+		{
+			return; //FIXME
+		}
+
+		if (GetWindowsDirectory(szTemp,MAX_PATH))
+		{
+			if (!GetDiskFreeSpaceEx(szTemp,&FreeBytesAvailable, &TotalNumberOfBytes, &TotalNumberOfFreeBytes))
+				TotalNumberOfFreeBytes.QuadPart = 0;
+		}
+		else
+		{
+			if (!GetDiskFreeSpaceEx(NULL,&FreeBytesAvailable, &TotalNumberOfBytes, &TotalNumberOfFreeBytes))
+				TotalNumberOfFreeBytes.QuadPart = 0;
+		}
+		if (TotalNumberOfFreeBytes.QuadPart > 0x100000)
+		{
+			if (LoadString(hApplet, IDS_SIZEMB, szTemp, MAX_PATH))
+			{
+				swprintf(szSize,szTemp,TotalNumberOfFreeBytes.QuadPart / 0x100000);
+				SetWindowText(GetDlgItem(hwndDlg, IDC_FREESPACE),szSize);
+			}
+		}
+		else
+		{
+			if (LoadString(hApplet, IDS_SIZEBYTS, szTemp, MAX_PATH))
+			{
+				swprintf(szSize,szTemp,TotalNumberOfFreeBytes.QuadPart);
+				SetWindowText(GetDlgItem(hwndDlg, IDC_FREESPACE),szSize);
+			}
+		}
+
+		if (msex.ullTotalPhys>0x100000)
+		{
+			if (LoadString(hApplet, IDS_SIZEMB, szTemp, MAX_PATH))
+			{
+				swprintf(szSize,szTemp,msex.ullTotalPhys/0x100000);
+				SetWindowText(GetDlgItem(hwndDlg, IDC_SPACEFORHIBERNATEFILE),szSize);
+			}
+		}
+		else
+		{
+			if (LoadString(hApplet, IDS_SIZEBYTS, szTemp, MAX_PATH))
+			{
+				swprintf(szSize,szTemp,msex.ullTotalPhys);
+				SetWindowText(GetDlgItem(hwndDlg, IDC_SPACEFORHIBERNATEFILE),szSize);
+			}
+		}
+		if (TotalNumberOfFreeBytes.QuadPart < msex.ullTotalPhys && !PowerCaps.HiberFilePresent)
+		{
+			EnableWindow(GetDlgItem(hwndDlg, IDC_HIBERNATEFILE), FALSE);		
+			ShowWindow(GetDlgItem(hwndDlg, IDC_TOLESSFREESPACE), TRUE);
+		}
+		else
+		{
+			ShowWindow(GetDlgItem(hwndDlg, IDC_TOLESSFREESPACE), FALSE);
+			EnableWindow(GetDlgItem(hwndDlg, IDC_HIBERNATEFILE), TRUE);
+		}
+	}
+}
+
+INT_PTR Hib_SaveData(HWND hwndDlg)
+{
+	BOOLEAN bHibernate;
+	
+	bHibernate = (BOOLEAN)SendMessageW(GetDlgItem(hwndDlg, IDC_HIBERNATEFILE),
+		BM_GETCHECK,
+		(WPARAM)0,
+		(LPARAM)0);
+	if (CallNtPowerInformation(SystemReserveHiberFile,&bHibernate, sizeof(bHibernate), NULL, 0) == STATUS_SUCCESS)
+	{
+		Pos_InitData();
+		Adv_InitDialog();
+		Hib_InitDialog(hwndDlg);
+		return TRUE;
+	}
+	return FALSE;
+}

Added: trunk/reactos/dll/cpl/powercfg/powercfg.c
URL: http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/cpl/powercfg/powercfg.c?rev=22362&view=auto
==============================================================================
--- trunk/reactos/dll/cpl/powercfg/powercfg.c (added)
+++ trunk/reactos/dll/cpl/powercfg/powercfg.c Thu Jun 15 18:07:08 2006
@@ -1,0 +1,177 @@
+/* $Id: powercfg.c 21500 2006-04-07 10:20:39Z janderwald $
+ *
+ * PROJECT:         ReactOS Power Configuration Applet
+ * LICENSE:         GPL - See COPYING in the top level directory
+ * FILE:            dll/cpl/powercfg/powershemes.c
+ * PURPOSE:         initialization of applet
+ * PROGRAMMERS:     Alexander Wurzinger (Lohnegrim at gmx dot net)
+ *                  Johannes Anderwald (johannes.anderwald at student.tugraz.at)
+ *                  Martin Rottensteiner
+ */
+
+#include <windows.h>
+#include <commctrl.h>
+#include <cpl.h>
+
+#include "resource.h"
+#include "powercfg.h"
+#include "powrprof.h"
+
+#define NUM_APPLETS	(1)
+
+LONG APIENTRY Applet1(HWND hwnd, UINT uMsg, LONG wParam, LONG lParam);
+INT_PTR CALLBACK powershemesProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
+INT_PTR CALLBACK alarmsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
+INT_PTR CALLBACK advancedProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
+INT_PTR CALLBACK hibernateProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
+
+HINSTANCE hApplet = 0;
+GLOBAL_POWER_POLICY gGPP;
+WCHAR langSel[255];
+
+/* Applets */
+APPLET Applets[NUM_APPLETS] = 
+{
+  {IDC_CPLICON_1, IDS_CPLNAME_1, IDS_CPLDESCRIPTION_1, Applet1}
+};
+
+static void
+InitPropSheetPage(PROPSHEETPAGE *psp, WORD idDlg, DLGPROC DlgProc)
+{
+  ZeroMemory(psp, sizeof(PROPSHEETPAGE));
+  psp->dwSize = sizeof(PROPSHEETPAGE);
+  psp->dwFlags = PSP_DEFAULT;
+  psp->hInstance = hApplet;
+  psp->pszTemplate = MAKEINTRESOURCE(idDlg);
+  psp->pfnDlgProc = DlgProc;
+}
+
+
+/* Property Sheet Callback */
+int CALLBACK
+PropSheetProc(
+	HWND hwndDlg,
+	UINT uMsg,
+	LPARAM lParam
+)
+{
+  switch(uMsg)
+  {
+    case PSCB_BUTTONPRESSED:
+      switch(lParam)
+      {
+        case PSBTN_OK: /* OK */
+          break;
+        case PSBTN_CANCEL: /* Cancel */
+          break;
+        case PSBTN_APPLYNOW: /* Apply now */
+          break;
+        case PSBTN_FINISH: /* Close */
+          break;
+        default:
+          return FALSE;
+      }
+      break;
+      
+    case PSCB_INITIALIZED:
+      break;
+  }
+  return TRUE;
+}
+
+/* First Applet */
+LONG APIENTRY
+Applet1(HWND hwnd, UINT uMsg, LONG wParam, LONG lParam)	
+{
+  PROPSHEETPAGE psp[5];
+  PROPSHEETHEADER psh;
+  TCHAR Caption[1024];
+  SYSTEM_POWER_CAPABILITIES spc;
+  INT i=0;
+  
+  memset(Caption, 0x0, sizeof(Caption));
+  LoadString(hApplet, IDS_CPLNAME_1, Caption, sizeof(Caption) / sizeof(TCHAR));
+  
+  ZeroMemory(&psh, sizeof(PROPSHEETHEADER));
+  psh.dwSize = sizeof(PROPSHEETHEADER);
+  psh.dwFlags =  PSH_PROPSHEETPAGE | PSH_USECALLBACK | PSH_PROPTITLE;
+  psh.hwndParent = NULL;
+  psh.hInstance = hApplet;
+  psh.hIcon = LoadIcon(hApplet, MAKEINTRESOURCE(IDC_CPLICON_1));
+  psh.pszCaption = Caption;
+  psh.nPages = 3;
+  psh.nStartPage = 0;
+  psh.ppsp = psp;
+  psh.pfnCallback = PropSheetProc;
+  
+  InitPropSheetPage(&psp[i++], IDD_PROPPAGEPOWERSHEMES, powershemesProc);
+  if (GetPwrCapabilities(&spc))
+  {
+    if (spc.SystemBatteriesPresent)
+	{
+	  InitPropSheetPage(&psp[i++], IDD_PROPPAGEALARMS, alarmsProc);
+	  psh.nPages += 1;
+	}
+  }
+  InitPropSheetPage(&psp[i++], IDD_PROPPAGEADVANCED, advancedProc);
+  InitPropSheetPage(&psp[i++], IDD_PROPPAGEHIBERNATE, hibernateProc);
+  
+  return (LONG)(PropertySheet(&psh) != -1);
+}
+
+/* Control Panel Callback */
+LONG CALLBACK
+CPlApplet(
+	HWND hwndCPl,
+	UINT uMsg,
+	LPARAM lParam1,
+	LPARAM lParam2)
+{
+  int i = (int)lParam1;
+  
+  switch(uMsg)
+  {
+    case CPL_INIT:
+    {
+      return TRUE;
+    }
+    case CPL_GETCOUNT:
+    {
+      return NUM_APPLETS;
+    }
+    case CPL_INQUIRE:
+    {
+      CPLINFO *CPlInfo = (CPLINFO*)lParam2;
+      CPlInfo->lData = 0;
+      CPlInfo->idIcon = Applets[i].idIcon;
+      CPlInfo->idName = Applets[i].idName;
+      CPlInfo->idInfo = Applets[i].idDescription;
+      break;
+    }
+    case CPL_DBLCLK:
+    {
+      Applets[i].AppletProc(hwndCPl, uMsg, lParam1, lParam2);
+      break;
+    }
+  }
+  return FALSE;
+}
+
+
+BOOLEAN
+WINAPI
+DllMain(
+	HINSTANCE hinstDLL,
+	DWORD     dwReason,
+	LPVOID    lpvReserved)
+{
+  switch(dwReason)
+  {
+    case DLL_PROCESS_ATTACH:
+    case DLL_THREAD_ATTACH:
+      hApplet = hinstDLL;
+      break;
+  }
+  return TRUE;
+}
+

Added: trunk/reactos/dll/cpl/powercfg/powercfg.def
URL: http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/cpl/powercfg/powercfg.def?rev=22362&view=auto
==============================================================================
--- trunk/reactos/dll/cpl/powercfg/powercfg.def (added)
+++ trunk/reactos/dll/cpl/powercfg/powercfg.def Thu Jun 15 18:07:08 2006
@@ -1,0 +1,6 @@
+LIBRARY powercfg.cpl
+
+EXPORTS
+CPlApplet at 16
+
+; EOF

Added: trunk/reactos/dll/cpl/powercfg/powercfg.h
URL: http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/cpl/powercfg/powercfg.h?rev=22362&view=auto
==============================================================================
--- trunk/reactos/dll/cpl/powercfg/powercfg.h (added)
+++ trunk/reactos/dll/cpl/powercfg/powercfg.h Thu Jun 15 18:07:08 2006
@@ -1,0 +1,21 @@
+#ifndef POWERCFG_H
+#define POWERCFG_H
+
+#include "powrprof.h"
+
+typedef struct
+{
+  int idIcon;
+  int idName;
+  int idDescription;
+  APPLET_PROC AppletProc;
+} APPLET, *PAPPLET;
+
+extern HINSTANCE hApplet;
+extern GLOBAL_POWER_POLICY gGPP;
+extern POWER_POLICY gPP[];
+extern UINT guiIndex;
+
+#endif /* __CPL_SAMPLE_H */
+
+/* EOF */

Added: trunk/reactos/dll/cpl/powercfg/powercfg.rbuild
URL: http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/cpl/powercfg/powercfg.rbuild?rev=22362&view=auto
==============================================================================
--- trunk/reactos/dll/cpl/powercfg/powercfg.rbuild (added)
+++ trunk/reactos/dll/cpl/powercfg/powercfg.rbuild Thu Jun 15 18:07:08 2006
@@ -1,0 +1,22 @@
+<module name="powercfg" type="win32dll" extension=".cpl" baseaddress="${BASEADDRESS_PWRCFG}" installbase="system32" installname="powercfg.cpl" allowwarnings="true">
+	<importlibrary definition="powercfg.def" />
+	<include base="powercfg">.</include>
+	<include base="ReactOS">include/wine</include>
+	<define name="UNICODE" />
+	<define name="_UNICODE" />
+	<define name="__REACTOS__" />
+	<define name="__USE_W32API" />
+	<define name="_WIN32_IE">0x600</define>
+	<define name="_WIN32_WINNT">0x501</define>
+	<library>kernel32</library>
+	<library>user32</library>
+	<library>powrprof</library>
+	<library>comctl32</library>
+	<library>rtl</library>
+	<file>powercfg.c</file>
+	<file>powershemes.c</file>
+	<file>alarms.c</file>
+	<file>advanced.c</file>
+	<file>hibernate.c</file>
+	<file>powercfg.rc</file>
+</module>

Added: trunk/reactos/dll/cpl/powercfg/powercfg.rc
URL: http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/cpl/powercfg/powercfg.rc?rev=22362&view=auto
==============================================================================
--- trunk/reactos/dll/cpl/powercfg/powercfg.rc (added)
+++ trunk/reactos/dll/cpl/powercfg/powercfg.rc Thu Jun 15 18:07:08 2006
@@ -1,0 +1,18 @@
+/* $Id: powercfg.rc 21982 2006-05-22 21:33:22Z janderwald $ */
+
+#include <windows.h>
+#include "resource.h"
+
+#define REACTOS_VERSION_DLL
+#define REACTOS_STR_FILE_DESCRIPTION	"ReactOS Powermanagement Control Panel\0"
+#define REACTOS_STR_INTERNAL_NAME	"powercfg\0"
+#define REACTOS_STR_ORIGINAL_FILENAME	"powercfg.cpl\0"
+#include <reactos/version.rc>
+
+IDI_AC ICON "resources/ac.ico"
+IDI_ACDC ICON "resources/acdc.ico"
+IDI_DC ICON "resources/dc.ico"
+IDI_SCREEN ICON "resources/screen.ico"
+
+#include "en.rc"
+#include "de.rc"

Added: trunk/reactos/dll/cpl/powercfg/powershemes.c
URL: http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/cpl/powercfg/powershemes.c?rev=22362&view=auto
==============================================================================
--- trunk/reactos/dll/cpl/powercfg/powershemes.c (added)
+++ trunk/reactos/dll/cpl/powercfg/powershemes.c Thu Jun 15 18:07:08 2006
@@ -1,0 +1,556 @@
+/* $Id: powershemes.c 21500 2006-04-07 10:20:39Z janderwald $
+ *
+ * PROJECT:         ReactOS Power Configuration Applet
+ * LICENSE:         GPL - See COPYING in the top level directory
+ * FILE:            dll/cpl/powercfg/powershemes.c
+ * PURPOSE:         powerschemes tab of applet
+ * PROGRAMMERS:     Alexander Wurzinger (Lohnegrim at gmx dot net)
+ *                  Johannes Anderwald (johannes.anderwald at student.tugraz.at)
+ *                  Martin Rottensteiner
+ */
+
+#include <windows.h>
+#include <commctrl.h>
+#include <cpl.h>
+#include <tchar.h>
+#include "resource.h"
+#include "powercfg.h"
+#include "stdio.h"
+
+UINT Sec[]=
+{
+	60,
+	120,
+	180,
+	300,
+	600,
+	900,
+	1200,
+	1500,
+	1800,
+	2700,
+	3600,
+	7200,
+	10800,
+	14400,
+	18000,
+	0
+};
+
+HWND hList = 0;
+HWND hPos = 0;
+
+unsigned aps = 0;
+
+#define MAX_POWER_POLICY	20
+
+POWER_POLICY gPP[MAX_POWER_POLICY];
+UINT guiIndex = 0;
+
+void LoadConfig(HWND hwndDlg);
+void Pos_InitPage(HWND hwndDlg);
+BOOLEAN Pos_InitData();
+void Pos_SaveData(HWND hwndDlg);
+
+
+BOOLEAN CreateEnergyList(HWND hwnd);
+
+/* Property page dialog callback */
+INT_PTR CALLBACK
+powershemesProc(
+  HWND hwndDlg,
+  UINT uMsg,
+  WPARAM wParam,
+  LPARAM lParam
+)
+{
+  switch(uMsg)
+  {
+    case WM_INITDIALOG:
+		hPos = hwndDlg;
+	    if (!Pos_InitData())
+		{
+			//TODO
+			// initialization failed
+			// handle error
+			MessageBox(hwndDlg,_T("Pos_InitData failed\n"), NULL, MB_OK);
+
+		}
+		if (!CreateEnergyList(GetDlgItem(hwndDlg, IDC_ENERGYLIST)))
+		{
+			//TODO
+			// initialization failed
+			// handle error
+			MessageBox(hwndDlg,_T("CreateEnergyList failed\n"), NULL, MB_OK);
+		}
+		return TRUE;
+	case WM_COMMAND:
+		switch(LOWORD(wParam))
+		{
+		case IDC_ENERGYLIST:
+			if (HIWORD(wParam) == CBN_SELCHANGE)
+			{
+				LoadConfig(hwndDlg);
+				PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
+			}
+			break;
+		case IDC_MONITORACLIST:
+		case IDC_MONITORDCLIST:
+		case IDC_DISKACLIST:
+		case IDC_DISKDCLIST:
+		case IDC_STANDBYACLIST:
+		case IDC_STANDBYDCLIST:
+		case IDC_HYBERNATEACLIST:
+		case IDC_HYBERNATEDCLIST:
+			if (HIWORD(wParam) == CBN_SELCHANGE)
+			{
+				PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
+			}
+			break;
+		}
+		break;
+	case WM_NOTIFY:
+		{
+			LPNMHDR lpnm = (LPNMHDR)lParam;
+			if (lpnm->code == (UINT)PSN_APPLY)
+			{
+				Pos_SaveData(hwndDlg);
+			}
+			return TRUE;
+		}
+		break;
+  }
+  return FALSE;
+}
+
+BOOLEAN Pos_InitData()
+{
+	SYSTEM_POWER_CAPABILITIES spc;
+/*
+	RECT rectCtl, rectDlg, rectCtl2;
+	LONG movetop = 0;
+	LONG moveright = 0;
+
+	if (GetWindowRect(hPos,&rectDlg))
+		{
+			if (GetWindowRect(GetDlgItem(hPos, IDC_SAT),&rectCtl2))
+			{
+				if (GetWindowRect(GetDlgItem(hPos, IDC_MONITOR),&rectCtl))
+				{
+					movetop=rectCtl.top - rectCtl2.top;
+					MoveWindow(GetDlgItem(hPos, IDC_MONITOR),rectCtl.left-rectDlg.left,rectCtl.top-rectDlg.top-movetop,rectCtl.right-rectCtl.left,rectCtl.bottom-rectCtl.top,FALSE);
+					if (GetWindowRect(GetDlgItem(hPos, IDC_DISK),&rectCtl))
+					{
+						MoveWindow(GetDlgItem(hPos, IDC_DISK),rectCtl.left-rectDlg.left,rectCtl.top-rectDlg.top-movetop,rectCtl.right-rectCtl.left,rectCtl.bottom-rectCtl.top,FALSE);
+					}
+					if (GetWindowRect(GetDlgItem(hPos, IDC_STANDBY),&rectCtl))
+					{
+						MoveWindow(GetDlgItem(hPos, IDC_STANDBY),rectCtl.left-rectDlg.left,rectCtl.top-rectDlg.top-movetop,rectCtl.right-rectCtl.left,rectCtl.bottom-rectCtl.top,FALSE);
+					}
+					if (GetWindowRect(GetDlgItem(hPos, IDC_HYBERNATE),&rectCtl))
+					{
+						MoveWindow(GetDlgItem(hPos, IDC_HYBERNATE),rectCtl.left-rectDlg.left,rectCtl.top-rectDlg.top-movetop,rectCtl.right-rectCtl.left,rectCtl.bottom-rectCtl.top,FALSE);
+					}
+					if (GetWindowRect(GetDlgItem(hPos, IDC_MONITORDCLIST),&rectCtl2))
+					{
+						movetop=movetop-8;
+						if (GetWindowRect(GetDlgItem(hPos, IDC_MONITORACLIST),&rectCtl))
+						{
+							moveright=rectCtl.right - rectCtl2.right;
+							MoveWindow(GetDlgItem(hPos, IDC_MONITORACLIST),rectCtl.left-rectDlg.left,rectCtl.top-rectDlg.top-movetop,rectCtl.right-rectCtl.left-moveright,rectCtl.bottom-rectCtl.top,FALSE);
+							if (GetWindowRect(GetDlgItem(hPos, IDC_DISKACLIST),&rectCtl))
+							{
+								MoveWindow(GetDlgItem(hPos, IDC_DISKACLIST),rectCtl.left-rectDlg.left,rectCtl.top-rectDlg.top-movetop,rectCtl.right-rectCtl.left-moveright,rectCtl.bottom-rectCtl.top,FALSE);
+							}
+							if (GetWindowRect(GetDlgItem(hPos, IDC_STANDBYACLIST),&rectCtl))
+							{
+								MoveWindow(GetDlgItem(hPos, IDC_STANDBYACLIST),rectCtl.left-rectDlg.left,rectCtl.top-rectDlg.top-movetop,rectCtl.right-rectCtl.left-moveright,rectCtl.bottom-rectCtl.top,FALSE);
+							}
+							if (GetWindowRect(GetDlgItem(hPos, IDC_HYBERNATEACLIST),&rectCtl))
+							{
+								MoveWindow(GetDlgItem(hPos, IDC_HYBERNATEACLIST),rectCtl.left-rectDlg.left,rectCtl.top-rectDlg.top-movetop,rectCtl.right-rectCtl.left-moveright,rectCtl.bottom-rectCtl.top,FALSE);
+							}
+						}
+						if (GetWindowRect(GetDlgItem(hPos, IDC_GRPDETAIL),&rectCtl))
+						{
+							MoveWindow(GetDlgItem(hPos, IDC_GRPDETAIL),rectCtl.left-rectDlg.left,rectCtl.top-rectDlg.top,rectCtl.right-rectCtl.left,rectCtl.bottom-rectCtl.top,FALSE);
+						}
+					}
+				}
+			}
+		}
+	}
+*/
+
+	if (!GetPwrCapabilities(&spc))
+	{
+		return FALSE;
+	}
+
+	if (!spc.SystemBatteriesPresent)
+	{
+		ShowWindow(GetDlgItem(hPos, IDC_SAT),FALSE);
+		ShowWindow(GetDlgItem(hPos, IDC_IAC),FALSE);
+		ShowWindow(GetDlgItem(hPos, IDC_SAC),FALSE);
+		ShowWindow(GetDlgItem(hPos, IDC_IDC),FALSE);
+		ShowWindow(GetDlgItem(hPos, IDC_SDC),FALSE);
+		ShowWindow(GetDlgItem(hPos, IDC_MONITORDCLIST),FALSE);
+		ShowWindow(GetDlgItem(hPos, IDC_DISKDCLIST),FALSE);
+		ShowWindow(GetDlgItem(hPos, IDC_STANDBYDCLIST),FALSE);
+		ShowWindow(GetDlgItem(hPos, IDC_HYBERNATEDCLIST),FALSE);
+		ShowWindow(GetDlgItem(hPos, IDC_HYBERNATEACLIST), spc.HiberFilePresent);
+		
+	}
+	else
+	{	
+		ShowWindow(GetDlgItem(hPos, IDC_HYBERNATEDCLIST), spc.HiberFilePresent);
+		ShowWindow(GetDlgItem(hPos, IDC_HYBERNATEACLIST), FALSE);
+	}
+
+
+	if (!(spc.SystemS1 ||spc.SystemS2 || spc.SystemS3))
+	{
+		ShowWindow(GetDlgItem(hPos, IDC_STANDBYACLIST), TRUE);
+		ShowWindow(GetDlgItem(hPos, IDC_STANDBYDCLIST), TRUE);
+		ShowWindow(GetDlgItem(hPos, IDC_STANDBY), TRUE);
+	}
+
+	ShowWindow(GetDlgItem(hPos, IDC_HYBERNATE), spc.HiberFilePresent);
+
+	return TRUE;
+}
+
+BOOLEAN CALLBACK callback_EnumPwrScheme(UINT uiIndex, DWORD dwName, LPWSTR sName, DWORD dwDesc,
+                                             LPWSTR sDesc, PPOWER_POLICY pp,LPARAM lParam )
+{
+	int index;
+	if (ValidatePowerPolicies(0,pp))
+	{
+		if (guiIndex >= MAX_POWER_POLICY)
+		{
+			//FIXME
+			//implement store power policy dynamically
+			return FALSE;
+		}
+
+
+		memcpy(&gPP[guiIndex], pp, sizeof(POWER_POLICY));
+		guiIndex++;
+
+		index = SendMessageW(hList,
+			   CB_ADDSTRING,
+			   0,
+			   (LPARAM)sName);
+		if (index == CB_ERR)
+			return FALSE;
+
+		SendMessageW(hList,
+			   CB_SETITEMDATA,
+			   index,
+			   (LPARAM)uiIndex);
+
+		if (aps == uiIndex)
+		{
+			SendMessageW(hList,
+			   CB_SELECTSTRING,
+			   TRUE,
+			   (LPARAM)sName);
+			LoadConfig(GetParent(hList));
+		}
+	}
+	return TRUE;
+}
+
+BOOLEAN CreateEnergyList(HWND hwnd)
+{
+	BOOLEAN retval;
+	POWER_POLICY pp;
+	SYSTEM_POWER_CAPABILITIES spc;
+
+	hList = hwnd;
+	
+	if (!GetActivePwrScheme(&aps))
+		return FALSE;
+	
+	if (!ReadGlobalPwrPolicy(&gGPP))
+		return FALSE;
+
+	if (!ReadPwrScheme(aps,&pp))
+		return FALSE;
+
+	if (!ValidatePowerPolicies(&gGPP,0))
+		return FALSE;
+
+	if (!SetActivePwrScheme(aps,&gGPP,&pp))
+		return FALSE;
+	
+	if (!GetPwrCapabilities(&spc))
+		return FALSE;
+
+	if (CanUserWritePwrScheme())
+	{
+		//TODO
+		// enable write / delete powerscheme button
+	}
+
+	Pos_InitPage(GetParent(hwnd));
+
+	if (!GetActivePwrScheme(&aps))
+		return FALSE;
+
+	retval = EnumPwrSchemes(callback_EnumPwrScheme, aps);
+
+	return retval;
+}
+
+void Pos_InitPage(HWND hwndDlg)
+{
+	int ifrom=0,i=0,imin=0;
+	HWND hwnd = NULL;
+	WCHAR szName[MAX_PATH];
+	LRESULT index;
+
+	for(i=1;i<9;i++)
+	{
+		switch(i)
+		{
+		case 1:
+			hwnd=GetDlgItem(hwndDlg, IDC_MONITORACLIST);
+			imin=IDS_TIMEOUT1;
+			break;
+		case 2:
+			hwnd=GetDlgItem(hwndDlg, IDC_STANDBYACLIST);
+			imin=IDS_TIMEOUT1;
+			break;
+		case 3:
+			hwnd=GetDlgItem(hwndDlg, IDC_DISKACLIST);
+			imin=IDS_TIMEOUT3;
+			break;
+		case 4:
+			hwnd=GetDlgItem(hwndDlg, IDC_HYBERNATEACLIST);
+			imin=IDS_TIMEOUT3;
+			break;
+		case 5:
+			hwnd=GetDlgItem(hwndDlg, IDC_MONITORDCLIST);
+			imin=IDS_TIMEOUT1;
+			break;
+		case 6:
+			hwnd=GetDlgItem(hwndDlg, IDC_STANDBYDCLIST);
+			imin=IDS_TIMEOUT1;
+			break;
+		case 7:
+			hwnd=GetDlgItem(hwndDlg, IDC_DISKDCLIST);
+			imin=IDS_TIMEOUT3;
+			break;
+		case 8:
+			hwnd=GetDlgItem(hwndDlg, IDC_HYBERNATEDCLIST);
+			imin=IDS_TIMEOUT3;
+			break;
+		default:
+			return;
+		}
+		for (ifrom=imin;ifrom<(IDS_TIMEOUT15+1);ifrom++)
+		{
+			if (LoadString(hApplet, ifrom, szName, MAX_PATH))
+			{
+				index = SendMessageW(hwnd,
+									 CB_ADDSTRING,
+									 0,
+									(LPARAM)szName);
+
+				if (index == CB_ERR)
+					return;
+
+				SendMessageW(hwnd,
+							 CB_SETITEMDATA,
+							 index,
+							 (LPARAM)Sec[ifrom-IDS_TIMEOUT16]);
+			}
+		}
+		if (LoadString(hApplet, IDS_TIMEOUT16, szName, MAX_PATH))
+		{
+			index = SendMessageW(hwnd,
+								 CB_ADDSTRING,
+								 0,
+								 (LPARAM)szName);
+			if (index == CB_ERR)
+				return;
+
+			SendMessageW(hwnd,
+					     CB_SETITEMDATA,
+						 index,
+						 (LPARAM)Sec[0]);
+		}
+	}
+}
+
+void LoadConfig(HWND hwndDlg)
+{
+	INT i=0, iCurSel=0;
+	UINT uiIndex;
+	WCHAR szProfile[MAX_PATH];
+	WCHAR szTemp[MAX_PATH];
+	WCHAR szConfig[MAX_PATH];
+	POWER_POLICY pp;
+
+	iCurSel = SendMessageW(GetDlgItem(hwndDlg, IDC_ENERGYLIST),
+		CB_GETCURSEL,
+		0,
+		0);
+	if (iCurSel == CB_ERR)
+		return;
+
+	memcpy(&pp, &gPP[iCurSel], sizeof(POWER_POLICY));
+
+	uiIndex = SendMessage(GetDlgItem(hwndDlg, IDC_ENERGYLIST), CB_GETCURSEL, 0, 0);
+    if(uiIndex != CB_ERR)
+	{
+		SendMessage(GetDlgItem(hwndDlg, IDC_ENERGYLIST), CB_GETLBTEXT, uiIndex, (LPARAM)szProfile);
+		if(LoadString(hApplet, IDS_CONFIG1, szTemp, MAX_PATH))
+		{
+			swprintf(szConfig,szTemp,szProfile);
+			SetWindowText(GetDlgItem(hwndDlg, IDC_GRPDETAIL),szConfig);
+		}
+	}
+	for(i=0;i<17;i++)
+	{
+		if (Sec[i]==pp.user.VideoTimeoutAc)
+		{
+			SendMessage(GetDlgItem(hwndDlg, IDC_MONITORACLIST),
+	 				    CB_SETCURSEL,
+						i,
+						(LPARAM)0);
+		}
+		if (Sec[i]==pp.user.VideoTimeoutDc)
+		{
+			SendMessage(GetDlgItem(hwndDlg, IDC_MONITORDCLIST),
+				 	    CB_SETCURSEL,
+						 i,
+						 (LPARAM)0);
+		}
+		if (Sec[i]==pp.user.SpindownTimeoutAc)
+		{
+			SendMessage(GetDlgItem(hwndDlg, IDC_DISKACLIST),
+					   CB_SETCURSEL,
+					   i-2,
+					   (LPARAM)0);
+		}
+		if (Sec[i]==pp.user.SpindownTimeoutDc)//IdleTimeoutDc)
+		{
+			SendMessage(GetDlgItem(hwndDlg, IDC_DISKDCLIST),
+					   CB_SETCURSEL,
+					   i-2,
+					   (LPARAM)0);
+		}
+		if (Sec[i]==pp.user.IdleTimeoutAc)
+		{
+			SendMessage(GetDlgItem(hwndDlg, IDC_STANDBYACLIST),
+					   CB_SETCURSEL,
+					   i,
+					   (LPARAM)0);
+		}
+		if (Sec[i]==pp.user.IdleTimeoutDc)
+		{
+			SendMessage(GetDlgItem(hwndDlg, IDC_STANDBYDCLIST),
+					   CB_SETCURSEL,
+					   i,
+					   (LPARAM)0);
+		}
+
+		if (Sec[i]==pp.mach.DozeS4TimeoutAc)
+		{
+			SendMessage(GetDlgItem(hwndDlg, IDC_HYBERNATEACLIST),
+					   CB_SETCURSEL,
+					   i,
+					(LPARAM)0);
+		}
+		if (Sec[i]==pp.mach.DozeS4TimeoutDc)
+		{
+			SendMessage(GetDlgItem(hwndDlg, IDC_HYBERNATEDCLIST),
+					   CB_SETCURSEL,
+					   i,
+					   (LPARAM)0);
+		}
+	}
+
+}
+
+void Pos_SaveData(HWND hwndDlg)
+{
+	INT iCurSel=0,tmp=0;
+
+	iCurSel = SendMessageW(GetDlgItem(hwndDlg, IDC_ENERGYLIST),
+		CB_GETCURSEL,
+		0,
+		0);
+	if (iCurSel == CB_ERR)
+		return;
+
+    tmp = SendMessage(GetDlgItem(hwndDlg, IDC_MONITORDCLIST),
+				   CB_GETCURSEL,
+				   0,
+				   (LPARAM)0);
+	if (tmp > 0 && tmp < 16)
+	{
+		gPP[iCurSel].user.VideoTimeoutAc = Sec[tmp];
+	}
+    tmp = SendMessage(GetDlgItem(hwndDlg, IDC_MONITORDCLIST),
+				   CB_GETCURSEL,
+				   0,
+				   (LPARAM)0);
+	if (tmp > 0 && tmp < 16)
+	{
+		gPP[iCurSel].user.VideoTimeoutDc = Sec[tmp];
+	}
+    tmp = SendMessage(GetDlgItem(hwndDlg, IDC_DISKACLIST),
+				   CB_GETCURSEL,
+				   0,
+				   (LPARAM)0);
+	if (tmp > 0 && tmp < 16)
+	{
+		gPP[iCurSel].user.SpindownTimeoutAc = Sec[tmp+2];
+	}
+    tmp = SendMessage(GetDlgItem(hwndDlg, IDC_DISKDCLIST),
+				   CB_GETCURSEL,
+				   0,
+				   (LPARAM)0);
+	if (tmp > 0 && tmp < 16)
+	{
+		gPP[iCurSel].user.SpindownTimeoutDc = Sec[tmp+2];
+	}
+    tmp = SendMessage(GetDlgItem(hwndDlg, IDC_STANDBYACLIST),
+				   CB_GETCURSEL,
+				   0,
+				   (LPARAM)0);
+	if (tmp > 0 && tmp < 16)
+	{
+		gPP[iCurSel].user.IdleTimeoutAc = Sec[tmp];
+	}
+    tmp = SendMessage(GetDlgItem(hwndDlg, IDC_STANDBYDCLIST),
+				   CB_GETCURSEL,
+				   0,
+				   (LPARAM)0);
+	if (tmp > 0 && tmp < 16)
+	{
+		gPP[iCurSel].user.IdleTimeoutDc = Sec[tmp];
+	}
+    tmp = SendMessage(GetDlgItem(hwndDlg, IDC_HYBERNATEACLIST),
+				   CB_GETCURSEL,
+				   0,
+				   (LPARAM)0);
+	if (tmp > 0 && tmp < 16)
+	{
+		gPP[iCurSel].mach.DozeS4TimeoutAc = Sec[tmp];
+	}
+    tmp = SendMessage(GetDlgItem(hwndDlg, IDC_HYBERNATEDCLIST),
+				   CB_GETCURSEL,
+				   0,
+				   (LPARAM)0);
+	if (tmp > 0 && tmp < 16)
+	{
+		gPP[iCurSel].mach.DozeS4TimeoutDc = Sec[tmp];
+	}
+
+    SetActivePwrScheme(iCurSel,NULL,&gPP[iCurSel]);
+	LoadConfig(hwndDlg);
+}

Added: trunk/reactos/dll/cpl/powercfg/resource.h
URL: http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/cpl/powercfg/resource.h?rev=22362&view=auto
==============================================================================
--- trunk/reactos/dll/cpl/powercfg/resource.h (added)
+++ trunk/reactos/dll/cpl/powercfg/resource.h Thu Jun 15 18:07:08 2006
@@ -1,0 +1,123 @@
+#ifndef __CPL_RESOURCE_H
+#define __CPL_RESOURCE_H
+
+/* metrics */
+#define PROPSHEETWIDTH  246
+#define PROPSHEETHEIGHT 228
+#define PROPSHEETPADDING        6
+#define SYSTEM_COLUMN   (18 * PROPSHEETPADDING)
+#define LABELLINE(x)    (((PROPSHEETPADDING + 2) * x) + (x + 2))
+#define ICONSIZE        16
+
+/* ids */
+#define IDC_CPLICON_1	                1
+
+#define IDS_PROCENT                     49
+#define IDS_SOUND                       50
+#define IDS_TEXT                        51
+#define IDS_CONFIG1                     53
+#define IDS_CONFIG2                     54
+#define IDS_SIZEBYTS                    55
+#define IDS_SIZEMB                      56
+
+#define IDD_PROPPAGEPOWERSHEMES         70
+#define IDD_PROPPAGEALARMS              71
+#define IDD_PROPPAGEPOWERMETER          72
+#define IDD_PROPPAGEADVANCED            73
+#define IDD_PROPPAGEHIBERNATE           74
+
+#define IDS_NOACTION                    100
+#define IDS_PowerActionNone1            114
+#define IDS_PowerActionUnknown          115
+#define IDS_PowerActionSleep            116
+#define IDS_PowerActionHibernate        117
+#define IDS_PowerActionShutdown         118
+#define IDS_PowerActionRestart          119
+#define IDS_PowerActionShutdownOff      120
+#define IDS_PowerActionWarmEject        121
+#define IDS_PowerActionNone2            122
+#define IDS_TIMEOUT16                   150
+#define IDS_TIMEOUT1                    151
+#define IDS_TIMEOUT2                    152
+#define IDS_TIMEOUT3                    153
+#define IDS_TIMEOUT4                    154
+#define IDS_TIMEOUT5                    155
+#define IDS_TIMEOUT6                    156
+#define IDS_TIMEOUT7                    157
+#define IDS_TIMEOUT8                    158
+#define IDS_TIMEOUT9                    159
+#define IDS_TIMEOUT10                   160
+#define IDS_TIMEOUT11                   161
+#define IDS_TIMEOUT12                   162
+#define IDS_TIMEOUT13                   163
+#define IDS_TIMEOUT14                   164
+#define IDS_TIMEOUT15                   165
+
+#define IDI_AC                          175
+#define IDI_DC                          176
+#define IDI_ACDC                        177
+#define IDI_SCREEN                      178
+
+#define IDS_CPLNAME_1	                190
+#define IDC_ENERGYLIST                  200
+#define IDC_GRPDETAIL                   201
+#define IDC_SAT                         202
+#define IDC_IAC                         203
+#define IDC_SAC                         204
+#define IDC_IDC                         205
+#define IDC_SDC                         206
+#define IDC_STANDBYACLIST               207
+#define IDC_STANDBYDCLIST               208
+#define IDC_MONITORACLIST               209
+#define IDC_MONITORDCLIST               210
+#define IDC_DISKACLIST                  216
+#define IDC_DISKDCLIST                  217
+#define IDC_DISK                        218
+#define IDC_HYBERNATEACLIST             219
+#define IDC_HYBERNATEDCLIST             220
+#define IDC_HYBERNATE                   221
+
+#define IDC_STANDBY                     211
+#define IDC_MONITOR                     212
+#define IDC_GRPPOWERSTATUS              213
+#define IDC_MULTIBATTERYDISPLAY         214
+
+#define IDC_ALARMMSG1                   301
+#define IDC_ALARMBAR1                   302
+#define IDC_ALARMBAR2                   303
+#define IDC_ALARMVALUE1                 304
+#define IDC_ALARMVALUE2                 305
+#define IDC_ALARM1                      306
+#define IDC_ALARM2                      307
+#define IDC_ALARMAKTION1                320
+#define IDC_ALARMPROG1                  322
+#define IDC_ALARMMSG2                   324
+#define IDC_ALARMAKTION2                323
+#define IDC_ALARMPROG2                  325
+
+#define IDC_SYSTRAYBATTERYMETER         400
+#define IDC_PASSWORDLOGON               401
+#define IDC_VIDEODIMDISPLAY             402
+#define IDC_SLIDCLOSE                   403
+#define IDC_LIDCLOSE                    404
+#define IDC_SPOWERBUTTON                405
+#define IDC_POWERBUTTON                 406
+#define IDC_SSLEEPBUTTON                407
+#define IDC_SLEEPBUTTON                 408
+
+#define IDC_HIBERNATEFILE               500
+#define IDC_FREESPACE                   501
+#define IDC_SPACEFORHIBERNATEFILE       502
+#define IDC_TOLESSFREESPACE             503
+
+#define IDS_ALPERTLOWENERGY						715
+#define IDS_ALPERTCRITICLEENERGY				716
+#define IDS_CRITCLENERGY						717
+#define IDS_LOWENERGY							718
+#define IDS_UNKNOWN								719
+
+#define IDS_CPLDESCRIPTION_1	        901
+
+#endif /* __CPL_RESOURCE_H */
+
+/* EOF */

Added: trunk/reactos/dll/cpl/powercfg/resources/ac.ico
URL: http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/cpl/powercfg/resources/ac.ico?rev=22362&view=auto
==============================================================================
Binary file - no diff available.

Propchange: trunk/reactos/dll/cpl/powercfg/resources/ac.ico
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: trunk/reactos/dll/cpl/powercfg/resources/acdc.ico
URL: http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/cpl/powercfg/resources/acdc.ico?rev=22362&view=auto
==============================================================================
Binary file - no diff available.

Propchange: trunk/reactos/dll/cpl/powercfg/resources/acdc.ico
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: trunk/reactos/dll/cpl/powercfg/resources/batterycharging.ico
URL: http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/cpl/powercfg/resources/batterycharging.ico?rev=22362&view=auto
==============================================================================
Binary file - no diff available.

Propchange: trunk/reactos/dll/cpl/powercfg/resources/batterycharging.ico
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: trunk/reactos/dll/cpl/powercfg/resources/batterychargingcritical.ico
URL: http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/cpl/powercfg/resources/batterychargingcritical.ico?rev=22362&view=auto
==============================================================================
Binary file - no diff available.

Propchange: trunk/reactos/dll/cpl/powercfg/resources/batterychargingcritical.ico
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: trunk/reactos/dll/cpl/powercfg/resources/batterycharginghalf.ico
URL: http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/cpl/powercfg/resources/batterycharginghalf.ico?rev=22362&view=auto
==============================================================================
Binary file - no diff available.

Propchange: trunk/reactos/dll/cpl/powercfg/resources/batterycharginghalf.ico
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: trunk/reactos/dll/cpl/powercfg/resources/batterycharginghigh.ico
URL: http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/cpl/powercfg/resources/batterycharginghigh.ico?rev=22362&view=auto
==============================================================================
Binary file - no diff available.

Propchange: trunk/reactos/dll/cpl/powercfg/resources/batterycharginghigh.ico
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: trunk/reactos/dll/cpl/powercfg/resources/batterycharginglow.ico
URL: http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/cpl/powercfg/resources/batterycharginglow.ico?rev=22362&view=auto
==============================================================================
Binary file - no diff available.

Propchange: trunk/reactos/dll/cpl/powercfg/resources/batterycharginglow.ico
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: trunk/reactos/dll/cpl/powercfg/resources/batterycritical.ico
URL: http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/cpl/powercfg/resources/batterycritical.ico?rev=22362&view=auto
==============================================================================
Binary file - no diff available.

Propchange: trunk/reactos/dll/cpl/powercfg/resources/batterycritical.ico
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: trunk/reactos/dll/cpl/powercfg/resources/batteryfull.ico
URL: http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/cpl/powercfg/resources/batteryfull.ico?rev=22362&view=auto
==============================================================================
Binary file - no diff available.

Propchange: trunk/reactos/dll/cpl/powercfg/resources/batteryfull.ico
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: trunk/reactos/dll/cpl/powercfg/resources/batteryhalf.ico
URL: http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/cpl/powercfg/resources/batteryhalf.ico?rev=22362&view=auto
==============================================================================
Binary file - no diff available.

Propchange: trunk/reactos/dll/cpl/powercfg/resources/batteryhalf.ico
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: trunk/reactos/dll/cpl/powercfg/resources/batteryhigh.ico
URL: http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/cpl/powercfg/resources/batteryhigh.ico?rev=22362&view=auto
==============================================================================
Binary file - no diff available.

Propchange: trunk/reactos/dll/cpl/powercfg/resources/batteryhigh.ico
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: trunk/reactos/dll/cpl/powercfg/resources/batterylow.ico
URL: http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/cpl/powercfg/resources/batterylow.ico?rev=22362&view=auto
==============================================================================
Binary file - no diff available.

Propchange: trunk/reactos/dll/cpl/powercfg/resources/batterylow.ico
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: trunk/reactos/dll/cpl/powercfg/resources/batteryunknown.ico
URL: http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/cpl/powercfg/resources/batteryunknown.ico?rev=22362&view=auto
==============================================================================
Binary file - no diff available.

Propchange: trunk/reactos/dll/cpl/powercfg/resources/batteryunknown.ico
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: trunk/reactos/dll/cpl/powercfg/resources/dc.ico
URL: http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/cpl/powercfg/resources/dc.ico?rev=22362&view=auto
==============================================================================
Binary file - no diff available.

Propchange: trunk/reactos/dll/cpl/powercfg/resources/dc.ico
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: trunk/reactos/dll/cpl/powercfg/resources/nobattery.ico
URL: http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/cpl/powercfg/resources/nobattery.ico?rev=22362&view=auto
==============================================================================
Binary file - no diff available.

Propchange: trunk/reactos/dll/cpl/powercfg/resources/nobattery.ico
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: trunk/reactos/dll/cpl/powercfg/resources/screen.ico
URL: http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/cpl/powercfg/resources/screen.ico?rev=22362&view=auto
==============================================================================
Binary file - no diff available.

Propchange: trunk/reactos/dll/cpl/powercfg/resources/screen.ico
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream




More information about the Ros-diffs mailing list