mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 18:15:11 +00:00
[POWERCFG] Fix indentation. No code changes!
This commit is contained in:
parent
88fbb600bf
commit
2872cfc3b7
1 changed files with 80 additions and 73 deletions
|
@ -26,7 +26,7 @@ TCHAR langSel[255];
|
||||||
/* Applets */
|
/* Applets */
|
||||||
APPLET Applets[NUM_APPLETS] =
|
APPLET Applets[NUM_APPLETS] =
|
||||||
{
|
{
|
||||||
{IDC_CPLICON_1, IDS_CPLNAME_1, IDS_CPLDESCRIPTION_1, Applet1}
|
{IDC_CPLICON_1, IDS_CPLNAME_1, IDS_CPLDESCRIPTION_1, Applet1}
|
||||||
};
|
};
|
||||||
|
|
||||||
static BOOL CALLBACK
|
static BOOL CALLBACK
|
||||||
|
@ -72,6 +72,7 @@ PropSheetProc(HWND hwndDlg, UINT uMsg, LPARAM lParam)
|
||||||
{
|
{
|
||||||
// NOTE: This callback is needed to set large icon correctly.
|
// NOTE: This callback is needed to set large icon correctly.
|
||||||
HICON hIcon;
|
HICON hIcon;
|
||||||
|
|
||||||
switch (uMsg)
|
switch (uMsg)
|
||||||
{
|
{
|
||||||
case PSCB_INITIALIZED:
|
case PSCB_INITIALIZED:
|
||||||
|
@ -88,54 +89,54 @@ PropSheetProc(HWND hwndDlg, UINT uMsg, LPARAM lParam)
|
||||||
static LONG APIENTRY
|
static LONG APIENTRY
|
||||||
Applet1(HWND hwnd, UINT uMsg, LPARAM wParam, LPARAM lParam)
|
Applet1(HWND hwnd, UINT uMsg, LPARAM wParam, LPARAM lParam)
|
||||||
{
|
{
|
||||||
HPROPSHEETPAGE hpsp[MAX_POWER_PAGES];
|
HPROPSHEETPAGE hpsp[MAX_POWER_PAGES];
|
||||||
PROPSHEETHEADER psh;
|
PROPSHEETHEADER psh;
|
||||||
HPSXA hpsxa = NULL;
|
HPSXA hpsxa = NULL;
|
||||||
TCHAR Caption[1024];
|
TCHAR Caption[1024];
|
||||||
SYSTEM_POWER_CAPABILITIES spc;
|
SYSTEM_POWER_CAPABILITIES spc;
|
||||||
LONG ret;
|
LONG ret;
|
||||||
|
|
||||||
UNREFERENCED_PARAMETER(uMsg);
|
UNREFERENCED_PARAMETER(uMsg);
|
||||||
UNREFERENCED_PARAMETER(wParam);
|
UNREFERENCED_PARAMETER(wParam);
|
||||||
UNREFERENCED_PARAMETER(lParam);
|
UNREFERENCED_PARAMETER(lParam);
|
||||||
|
|
||||||
memset(Caption, 0x0, sizeof(Caption));
|
memset(Caption, 0x0, sizeof(Caption));
|
||||||
LoadString(hApplet, IDS_CPLNAME_1, Caption, sizeof(Caption) / sizeof(TCHAR));
|
LoadString(hApplet, IDS_CPLNAME_1, Caption, sizeof(Caption) / sizeof(TCHAR));
|
||||||
|
|
||||||
ZeroMemory(&psh, sizeof(PROPSHEETHEADER));
|
ZeroMemory(&psh, sizeof(PROPSHEETHEADER));
|
||||||
psh.dwSize = sizeof(PROPSHEETHEADER);
|
psh.dwSize = sizeof(PROPSHEETHEADER);
|
||||||
psh.dwFlags = PSH_PROPTITLE | PSH_USEICONID | PSH_USECALLBACK;
|
psh.dwFlags = PSH_PROPTITLE | PSH_USEICONID | PSH_USECALLBACK;
|
||||||
psh.hwndParent = hwnd;
|
psh.hwndParent = hwnd;
|
||||||
psh.hInstance = hApplet;
|
psh.hInstance = hApplet;
|
||||||
psh.pszIcon = MAKEINTRESOURCEW(IDC_CPLICON_1);
|
psh.pszIcon = MAKEINTRESOURCEW(IDC_CPLICON_1);
|
||||||
psh.pszCaption = Caption;
|
psh.pszCaption = Caption;
|
||||||
psh.nPages = 0;
|
psh.nPages = 0;
|
||||||
psh.nStartPage = 0;
|
psh.nStartPage = 0;
|
||||||
psh.phpage = hpsp;
|
psh.phpage = hpsp;
|
||||||
psh.pfnCallback = PropSheetProc;
|
psh.pfnCallback = PropSheetProc;
|
||||||
|
|
||||||
InitPropSheetPage(&psh, IDD_PROPPAGEPOWERSCHEMES, PowerSchemesDlgProc);
|
InitPropSheetPage(&psh, IDD_PROPPAGEPOWERSCHEMES, PowerSchemesDlgProc);
|
||||||
if (GetPwrCapabilities(&spc))
|
if (GetPwrCapabilities(&spc))
|
||||||
{
|
|
||||||
if (spc.SystemBatteriesPresent)
|
|
||||||
{
|
{
|
||||||
InitPropSheetPage(&psh, IDD_PROPPAGEALARMS, AlarmsDlgProc);
|
if (spc.SystemBatteriesPresent)
|
||||||
|
{
|
||||||
|
InitPropSheetPage(&psh, IDD_PROPPAGEALARMS, AlarmsDlgProc);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
InitPropSheetPage(&psh, IDD_PROPPAGEADVANCED, AdvancedDlgProc);
|
||||||
InitPropSheetPage(&psh, IDD_PROPPAGEADVANCED, AdvancedDlgProc);
|
InitPropSheetPage(&psh, IDD_PROPPAGEHIBERNATE, HibernateDlgProc);
|
||||||
InitPropSheetPage(&psh, IDD_PROPPAGEHIBERNATE, HibernateDlgProc);
|
|
||||||
|
|
||||||
/* Load additional pages provided by shell extensions */
|
/* Load additional pages provided by shell extensions */
|
||||||
hpsxa = SHCreatePropSheetExtArray(HKEY_LOCAL_MACHINE, REGSTR_PATH_CONTROLSFOLDER TEXT("\\Power"), MAX_POWER_PAGES - psh.nPages);
|
hpsxa = SHCreatePropSheetExtArray(HKEY_LOCAL_MACHINE, REGSTR_PATH_CONTROLSFOLDER TEXT("\\Power"), MAX_POWER_PAGES - psh.nPages);
|
||||||
if (hpsxa != NULL)
|
if (hpsxa != NULL)
|
||||||
SHAddFromPropSheetExtArray(hpsxa, PropSheetAddPage, (LPARAM)&psh);
|
SHAddFromPropSheetExtArray(hpsxa, PropSheetAddPage, (LPARAM)&psh);
|
||||||
|
|
||||||
ret = (LONG)(PropertySheet(&psh) != -1);
|
ret = (LONG)(PropertySheet(&psh) != -1);
|
||||||
|
|
||||||
if (hpsxa != NULL)
|
if (hpsxa != NULL)
|
||||||
SHDestroyPropSheetExtArray(hpsxa);
|
SHDestroyPropSheetExtArray(hpsxa);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Control Panel Callback */
|
/* Control Panel Callback */
|
||||||
|
@ -145,34 +146,38 @@ CPlApplet(HWND hwndCPl,
|
||||||
LPARAM lParam1,
|
LPARAM lParam1,
|
||||||
LPARAM lParam2)
|
LPARAM lParam2)
|
||||||
{
|
{
|
||||||
int i = (int)lParam1;
|
int i = (int)lParam1;
|
||||||
|
|
||||||
switch(uMsg)
|
switch (uMsg)
|
||||||
{
|
|
||||||
case CPL_INIT:
|
|
||||||
{
|
{
|
||||||
return TRUE;
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
case CPL_GETCOUNT:
|
|
||||||
{
|
return FALSE;
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -181,13 +186,15 @@ DllMain(HINSTANCE hinstDLL,
|
||||||
DWORD dwReason,
|
DWORD dwReason,
|
||||||
LPVOID lpvReserved)
|
LPVOID lpvReserved)
|
||||||
{
|
{
|
||||||
UNREFERENCED_PARAMETER(lpvReserved);
|
UNREFERENCED_PARAMETER(lpvReserved);
|
||||||
switch(dwReason)
|
|
||||||
{
|
switch(dwReason)
|
||||||
case DLL_PROCESS_ATTACH:
|
{
|
||||||
case DLL_THREAD_ATTACH:
|
case DLL_PROCESS_ATTACH:
|
||||||
hApplet = hinstDLL;
|
case DLL_THREAD_ATTACH:
|
||||||
break;
|
hApplet = hinstDLL;
|
||||||
}
|
break;
|
||||||
return TRUE;
|
}
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue