[DESK.CPL]: Fix trailing whitespace, some indent + code formatting style.

svn path=/trunk/; revision=73044
This commit is contained in:
Hermès Bélusca-Maïto 2016-10-26 21:14:39 +00:00
parent 682cc491e7
commit 60cf552825
14 changed files with 231 additions and 232 deletions

View file

@ -522,7 +522,7 @@ AdvAppearanceDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
break; break;
case WM_COMMAND: case WM_COMMAND:
if(g == NULL) if (g == NULL)
return TRUE; return TRUE;
switch(LOWORD(wParam)) switch(LOWORD(wParam))
@ -558,7 +558,7 @@ AdvAppearanceDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
if (HIWORD(wParam) == EN_CHANGE) if (HIWORD(wParam) == EN_CHANGE)
{ {
iProperty = g_Assignment[g->CurrentElement].Size; iProperty = g_Assignment[g->CurrentElement].Size;
if(iProperty == -1) if (iProperty == -1)
return TRUE; return TRUE;
iSelection = LOWORD(SendDlgItemMessage(hwndDlg, IDC_ADVAPPEARANCE_SIZE_UD, UDM_GETPOS,0,0L)); iSelection = LOWORD(SendDlgItemMessage(hwndDlg, IDC_ADVAPPEARANCE_SIZE_UD, UDM_GETPOS,0,0L));
@ -566,7 +566,7 @@ AdvAppearanceDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_PREVIEW, PVM_SETSIZE, iProperty, iSelection); SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_PREVIEW, PVM_SETSIZE, iProperty, iSelection);
iProperty = g_Assignment[g->CurrentElement].Size2; iProperty = g_Assignment[g->CurrentElement].Size2;
if(iProperty != -1) if (iProperty != -1)
SchemeSetMetric(&g->SchemeAdv, iProperty, iSelection); SchemeSetMetric(&g->SchemeAdv, iProperty, iSelection);
} }
break; break;
@ -575,7 +575,7 @@ AdvAppearanceDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
if (HIWORD(wParam) == CBN_SELCHANGE) if (HIWORD(wParam) == CBN_SELCHANGE)
{ {
iProperty = g_Assignment[g->CurrentElement].Font; iProperty = g_Assignment[g->CurrentElement].Font;
if(iProperty == -1) if (iProperty == -1)
return TRUE; return TRUE;
plfFont = SchemeGetFont(&g->SchemeAdv, iProperty); plfFont = SchemeGetFont(&g->SchemeAdv, iProperty);
@ -590,7 +590,7 @@ AdvAppearanceDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
HDC hdcDlg; HDC hdcDlg;
iProperty = g_Assignment[g->CurrentElement].Font; iProperty = g_Assignment[g->CurrentElement].Font;
if(iProperty == -1) if (iProperty == -1)
return TRUE; return TRUE;
hdcDlg = GetDC(hwndDlg); hdcDlg = GetDC(hwndDlg);
@ -608,7 +608,7 @@ AdvAppearanceDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
if (HIWORD(wParam) == BN_CLICKED) if (HIWORD(wParam) == BN_CLICKED)
{ {
iProperty = g_Assignment[g->CurrentElement].Font; iProperty = g_Assignment[g->CurrentElement].Font;
if(iProperty == -1) if (iProperty == -1)
return TRUE; return TRUE;
plfFont = SchemeGetFont(&g->SchemeAdv, iProperty); plfFont = SchemeGetFont(&g->SchemeAdv, iProperty);
@ -622,7 +622,7 @@ AdvAppearanceDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
if (HIWORD(wParam) == BN_CLICKED) if (HIWORD(wParam) == BN_CLICKED)
{ {
iProperty = g_Assignment[g->CurrentElement].Font; iProperty = g_Assignment[g->CurrentElement].Font;
if(iProperty == -1) if (iProperty == -1)
return TRUE; return TRUE;
plfFont = SchemeGetFont(&g->SchemeAdv, iProperty); plfFont = SchemeGetFont(&g->SchemeAdv, iProperty);

View file

@ -111,7 +111,7 @@ DisplayAdvancedSettings(HWND hWndParent, PDISPLAY_DEVICE_ENTRY DisplayDevice)
#ifdef _MSC_VER #ifdef _MSC_VER
hShell32 = LoadLibrary(_T("shell32.dll")); hShell32 = LoadLibrary(_T("shell32.dll"));
if(hShell32 == NULL) if (hShell32 == NULL)
return FALSE; return FALSE;
msvc_SHCreatePropSheetExtArrayEx = (CPSEAE)GetProcAddress(hShell32, (LPCSTR)194); msvc_SHCreatePropSheetExtArrayEx = (CPSEAE)GetProcAddress(hShell32, (LPCSTR)194);
hpsxaDev = msvc_SHCreatePropSheetExtArrayEx(HKEY_LOCAL_MACHINE, REGSTR_PATH_CONTROLSFOLDER TEXT("\\Device"), MAX_ADVANCED_PAGES - psh.nPages, pdo); hpsxaDev = msvc_SHCreatePropSheetExtArrayEx(HKEY_LOCAL_MACHINE, REGSTR_PATH_CONTROLSFOLDER TEXT("\\Device"), MAX_ADVANCED_PAGES - psh.nPages, pdo);

View file

@ -31,7 +31,7 @@ AppearancePage_UpdateThemePreview(HWND hwndDlg, GLOBALS *g)
SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_PREVIEW, PVM_SET_HDC_PREVIEW, 0, 0); SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_PREVIEW, PVM_SET_HDC_PREVIEW, 0, 0);
} }
static void static void
AppearancePage_LoadSelectedScheme(HWND hwndDlg, GLOBALS *g) AppearancePage_LoadSelectedScheme(HWND hwndDlg, GLOBALS *g)
{ {
if (g->ActiveTheme.ThemeActive == FALSE ) if (g->ActiveTheme.ThemeActive == FALSE )
@ -39,7 +39,7 @@ AppearancePage_LoadSelectedScheme(HWND hwndDlg, GLOBALS *g)
LoadSchemeFromReg(&g->Scheme, &g->ActiveTheme); LoadSchemeFromReg(&g->Scheme, &g->ActiveTheme);
} }
else else
{ {
LoadSchemeFromTheme(&g->Scheme, &g->ActiveTheme); LoadSchemeFromTheme(&g->Scheme, &g->ActiveTheme);
} }
@ -71,9 +71,9 @@ AppearancePage_ShowStyles(HWND hwndDlg, int nIDDlgItem, PTHEME_STYLE pStyles, PT
static void static void
AppearancePage_ShowColorSchemes(HWND hwndDlg, GLOBALS *g) AppearancePage_ShowColorSchemes(HWND hwndDlg, GLOBALS *g)
{ {
AppearancePage_ShowStyles(hwndDlg, AppearancePage_ShowStyles(hwndDlg,
IDC_APPEARANCE_COLORSCHEME, IDC_APPEARANCE_COLORSCHEME,
g->ActiveTheme.Theme->ColoursList, g->ActiveTheme.Theme->ColoursList,
g->ActiveTheme.Color); g->ActiveTheme.Color);
} }
@ -87,9 +87,9 @@ AppearancePage_ShowSizes(HWND hwndDlg, GLOBALS *g)
else else
pSizes = g->ActiveTheme.Color->ChildStyle; pSizes = g->ActiveTheme.Color->ChildStyle;
AppearancePage_ShowStyles(hwndDlg, AppearancePage_ShowStyles(hwndDlg,
IDC_APPEARANCE_SIZE, IDC_APPEARANCE_SIZE,
pSizes, pSizes,
g->ActiveTheme.Size); g->ActiveTheme.Size);
} }
@ -120,7 +120,7 @@ AppearancePage_OnInit(HWND hwndDlg)
if (!GetActiveTheme(g->pThemes, &g->ActiveTheme)) if (!GetActiveTheme(g->pThemes, &g->ActiveTheme))
g->ActiveTheme.ThemeActive = FALSE; g->ActiveTheme.ThemeActive = FALSE;
/* /*
* Keep a copy of the selected classic theme in order to select this * Keep a copy of the selected classic theme in order to select this
* when user selects the classic theme (and not a horrible random theme ) * when user selects the classic theme (and not a horrible random theme )
*/ */
@ -203,7 +203,7 @@ AppearancePageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
break; break;
case WM_COMMAND: case WM_COMMAND:
if(g == NULL || g->bInitializing) if (g == NULL || g->bInitializing)
return FALSE; return FALSE;
switch (LOWORD(wParam)) switch (LOWORD(wParam))
@ -254,7 +254,7 @@ AppearancePageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
if (HIWORD(wParam) == CBN_SELCHANGE) if (HIWORD(wParam) == CBN_SELCHANGE)
{ {
PTHEME pTheme = (PTHEME)GetSelectedData(hwndDlg, IDC_APPEARANCE_VISUAL_STYLE); PTHEME pTheme = (PTHEME)GetSelectedData(hwndDlg, IDC_APPEARANCE_VISUAL_STYLE);
if (g->ClassicTheme.Theme == pTheme) if (g->ClassicTheme.Theme == pTheme)
g->ActiveTheme = g->ClassicTheme; g->ActiveTheme = g->ClassicTheme;
else else
@ -282,7 +282,7 @@ AppearancePageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{ {
g->ActiveTheme.Size = (PTHEME_STYLE)GetSelectedData(hwndDlg, IDC_APPEARANCE_SIZE); g->ActiveTheme.Size = (PTHEME_STYLE)GetSelectedData(hwndDlg, IDC_APPEARANCE_SIZE);
g->bSchemeChanged = TRUE; g->bSchemeChanged = TRUE;
if(g->ActiveTheme.ThemeActive) if (g->ActiveTheme.ThemeActive)
g->bThemeChanged = TRUE; g->bThemeChanged = TRUE;
PropSheet_Changed(GetParent(hwndDlg), hwndDlg); PropSheet_Changed(GetParent(hwndDlg), hwndDlg);

View file

@ -258,7 +258,7 @@ AddWallpapersFromDirectory(UINT uCounter, HWND hwndBackgroundList, BackgroundIte
pData->listViewItemCount++; pData->listViewItemCount++;
} }
if(!FindNextFile(hFind, &fd)) if (!FindNextFile(hFind, &fd))
break; break;
} }
@ -1111,9 +1111,9 @@ BackgroundPageProc(HWND hwndDlg,
switch(lpnm->code) switch(lpnm->code)
{ {
case PSN_APPLY: case PSN_APPLY:
if(pData->bWallpaperChanged) if (pData->bWallpaperChanged)
SetWallpaper(pData); SetWallpaper(pData);
if(pData->bClrBackgroundChanged) if (pData->bClrBackgroundChanged)
SetDesktopBackColor(hwndDlg, pData); SetDesktopBackColor(hwndDlg, pData);
SendMessage(HWND_BROADCAST, WM_SETTINGCHANGE, 0, (LPARAM)_T("")); SendMessage(HWND_BROADCAST, WM_SETTINGCHANGE, 0, (LPARAM)_T(""));
return TRUE; return TRUE;

View file

@ -38,7 +38,7 @@ DisplayClassInstaller(
return ERROR_DI_DO_DEFAULT; return ERROR_DI_DO_DEFAULT;
/* Set DI_DONOTCALLCONFIGMG flag */ /* Set DI_DONOTCALLCONFIGMG flag */
InstallParams.cbSize = sizeof(SP_DEVINSTALL_PARAMS); InstallParams.cbSize = sizeof(InstallParams);
result = SetupDiGetDeviceInstallParams(DeviceInfoSet, DeviceInfoData, &InstallParams); result = SetupDiGetDeviceInstallParams(DeviceInfoSet, DeviceInfoData, &InstallParams);
if (!result) if (!result)
{ {
@ -67,7 +67,7 @@ DisplayClassInstaller(
} }
/* Get .inf file name and section name */ /* Get .inf file name and section name */
DriverInfoData.cbSize = sizeof(SP_DRVINFO_DATA); DriverInfoData.cbSize = sizeof(DriverInfoData);
result = SetupDiGetSelectedDriver(DeviceInfoSet, DeviceInfoData, &DriverInfoData); result = SetupDiGetSelectedDriver(DeviceInfoSet, DeviceInfoData, &DriverInfoData);
if (!result) if (!result)
{ {
@ -76,11 +76,10 @@ DisplayClassInstaller(
goto cleanup; goto cleanup;
} }
DriverInfoDetailData.cbSize = sizeof(SP_DRVINFO_DETAIL_DATA); DriverInfoDetailData.cbSize = sizeof(DriverInfoDetailData);
result = SetupDiGetDriverInfoDetail( result = SetupDiGetDriverInfoDetail(DeviceInfoSet, DeviceInfoData,
DeviceInfoSet, DeviceInfoData, &DriverInfoData, &DriverInfoDetailData,
&DriverInfoData, &DriverInfoDetailData, sizeof(DriverInfoDetailData), NULL);
sizeof(SP_DRVINFO_DETAIL_DATA), NULL);
if (!result && GetLastError() != ERROR_INSUFFICIENT_BUFFER) if (!result && GetLastError() != ERROR_INSUFFICIENT_BUFFER)
{ {
rc = GetLastError(); rc = GetLastError();

View file

@ -120,7 +120,7 @@ HPSXA WINAPI SHCreatePropSheetExtArrayEx(HKEY,LPCWSTR,UINT,IDataObject*);
INT_PTR CALLBACK INT_PTR CALLBACK
AdvGeneralPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); AdvGeneralPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
LONG LONG
RegLoadMUIStringW(IN HKEY hKey, RegLoadMUIStringW(IN HKEY hKey,
IN LPCWSTR pszValue OPTIONAL, IN LPCWSTR pszValue OPTIONAL,
OUT LPWSTR pszOutBuf, OUT LPWSTR pszOutBuf,

View file

@ -81,16 +81,16 @@ MyIntDrawRectEdge(HDC hdc, LPRECT rc, UINT uType, UINT uFlags, COLOR_SCHEME *sch
RBInnerI = RBInnerNormal[uType & (BDR_INNER|BDR_OUTER)]; RBInnerI = RBInnerNormal[uType & (BDR_INNER|BDR_OUTER)];
RBOuterI = RBOuterNormal[uType & (BDR_INNER|BDR_OUTER)]; RBOuterI = RBOuterNormal[uType & (BDR_INNER|BDR_OUTER)];
if((uFlags & BF_BOTTOMLEFT) == BF_BOTTOMLEFT) if ((uFlags & BF_BOTTOMLEFT) == BF_BOTTOMLEFT)
LBpenplus = 1; LBpenplus = 1;
if((uFlags & BF_TOPRIGHT) == BF_TOPRIGHT) if ((uFlags & BF_TOPRIGHT) == BF_TOPRIGHT)
RTpenplus = 1; RTpenplus = 1;
if((uFlags & BF_BOTTOMRIGHT) == BF_BOTTOMRIGHT) if ((uFlags & BF_BOTTOMRIGHT) == BF_BOTTOMRIGHT)
RBpenplus = 1; RBpenplus = 1;
if((uFlags & BF_TOPLEFT) == BF_TOPLEFT) if ((uFlags & BF_TOPLEFT) == BF_TOPLEFT)
LTpenplus = 1; LTpenplus = 1;
if((uFlags & MY_BF_ACTIVEBORDER)) if ((uFlags & MY_BF_ACTIVEBORDER))
hbr = CreateSolidBrush(scheme->crColor[COLOR_ACTIVEBORDER]); hbr = CreateSolidBrush(scheme->crColor[COLOR_ACTIVEBORDER]);
else else
hbr = CreateSolidBrush(scheme->crColor[COLOR_BTNFACE]); hbr = CreateSolidBrush(scheme->crColor[COLOR_BTNFACE]);
@ -101,34 +101,34 @@ MyIntDrawRectEdge(HDC hdc, LPRECT rc, UINT uType, UINT uFlags, COLOR_SCHEME *sch
MoveToEx(hdc, 0, 0, &SavePoint); MoveToEx(hdc, 0, 0, &SavePoint);
/* Draw the outer edge */ /* Draw the outer edge */
if(LTOuterI != -1) if (LTOuterI != -1)
{ {
LTOuterPen = GetStockObject(DC_PEN); LTOuterPen = GetStockObject(DC_PEN);
SelectObject(hdc, LTOuterPen); SelectObject(hdc, LTOuterPen);
SetDCPenColor(hdc, scheme->crColor[LTOuterI]); SetDCPenColor(hdc, scheme->crColor[LTOuterI]);
if(uFlags & BF_TOP) if (uFlags & BF_TOP)
{ {
MoveToEx(hdc, InnerRect.left, InnerRect.top, NULL); MoveToEx(hdc, InnerRect.left, InnerRect.top, NULL);
LineTo(hdc, InnerRect.right, InnerRect.top); LineTo(hdc, InnerRect.right, InnerRect.top);
} }
if(uFlags & BF_LEFT) if (uFlags & BF_LEFT)
{ {
MoveToEx(hdc, InnerRect.left, InnerRect.top, NULL); MoveToEx(hdc, InnerRect.left, InnerRect.top, NULL);
LineTo(hdc, InnerRect.left, InnerRect.bottom); LineTo(hdc, InnerRect.left, InnerRect.bottom);
} }
} }
if(RBOuterI != -1) if (RBOuterI != -1)
{ {
RBOuterPen = GetStockObject(DC_PEN); RBOuterPen = GetStockObject(DC_PEN);
SelectObject(hdc, RBOuterPen); SelectObject(hdc, RBOuterPen);
SetDCPenColor(hdc, scheme->crColor[RBOuterI]); SetDCPenColor(hdc, scheme->crColor[RBOuterI]);
if(uFlags & BF_BOTTOM) if (uFlags & BF_BOTTOM)
{ {
MoveToEx(hdc, InnerRect.left, InnerRect.bottom-1, NULL); MoveToEx(hdc, InnerRect.left, InnerRect.bottom-1, NULL);
LineTo(hdc, InnerRect.right, InnerRect.bottom-1); LineTo(hdc, InnerRect.right, InnerRect.bottom-1);
} }
if(uFlags & BF_RIGHT) if (uFlags & BF_RIGHT)
{ {
MoveToEx(hdc, InnerRect.right-1, InnerRect.top, NULL); MoveToEx(hdc, InnerRect.right-1, InnerRect.top, NULL);
LineTo(hdc, InnerRect.right-1, InnerRect.bottom); LineTo(hdc, InnerRect.right-1, InnerRect.bottom);
@ -136,34 +136,34 @@ MyIntDrawRectEdge(HDC hdc, LPRECT rc, UINT uType, UINT uFlags, COLOR_SCHEME *sch
} }
/* Draw the inner edge */ /* Draw the inner edge */
if(LTInnerI != -1) if (LTInnerI != -1)
{ {
LTInnerPen = GetStockObject(DC_PEN); LTInnerPen = GetStockObject(DC_PEN);
SelectObject(hdc, LTInnerPen); SelectObject(hdc, LTInnerPen);
SetDCPenColor(hdc, scheme->crColor[LTInnerI]); SetDCPenColor(hdc, scheme->crColor[LTInnerI]);
if(uFlags & BF_TOP) if (uFlags & BF_TOP)
{ {
MoveToEx(hdc, InnerRect.left+LTpenplus, InnerRect.top+1, NULL); MoveToEx(hdc, InnerRect.left+LTpenplus, InnerRect.top+1, NULL);
LineTo(hdc, InnerRect.right-RTpenplus, InnerRect.top+1); LineTo(hdc, InnerRect.right-RTpenplus, InnerRect.top+1);
} }
if(uFlags & BF_LEFT) if (uFlags & BF_LEFT)
{ {
MoveToEx(hdc, InnerRect.left+1, InnerRect.top+LTpenplus, NULL); MoveToEx(hdc, InnerRect.left+1, InnerRect.top+LTpenplus, NULL);
LineTo(hdc, InnerRect.left+1, InnerRect.bottom-LBpenplus); LineTo(hdc, InnerRect.left+1, InnerRect.bottom-LBpenplus);
} }
} }
if(RBInnerI != -1) if (RBInnerI != -1)
{ {
RBInnerPen = GetStockObject(DC_PEN); RBInnerPen = GetStockObject(DC_PEN);
SelectObject(hdc, RBInnerPen); SelectObject(hdc, RBInnerPen);
SetDCPenColor(hdc, scheme->crColor[RBInnerI]); SetDCPenColor(hdc, scheme->crColor[RBInnerI]);
if(uFlags & BF_BOTTOM) if (uFlags & BF_BOTTOM)
{ {
MoveToEx(hdc, InnerRect.left+LBpenplus, InnerRect.bottom-2, NULL); MoveToEx(hdc, InnerRect.left+LBpenplus, InnerRect.bottom-2, NULL);
LineTo(hdc, InnerRect.right-RBpenplus, InnerRect.bottom-2); LineTo(hdc, InnerRect.right-RBpenplus, InnerRect.bottom-2);
} }
if(uFlags & BF_RIGHT) if (uFlags & BF_RIGHT)
{ {
MoveToEx(hdc, InnerRect.right-2, InnerRect.top+RTpenplus, NULL); MoveToEx(hdc, InnerRect.right-2, InnerRect.top+RTpenplus, NULL);
LineTo(hdc, InnerRect.right-2, InnerRect.bottom-RBpenplus); LineTo(hdc, InnerRect.right-2, InnerRect.bottom-RBpenplus);
@ -175,16 +175,16 @@ MyIntDrawRectEdge(HDC hdc, LPRECT rc, UINT uType, UINT uFlags, COLOR_SCHEME *sch
int add = (LTRBInnerMono[uType & (BDR_INNER|BDR_OUTER)] != -1 ? 1 : 0) int add = (LTRBInnerMono[uType & (BDR_INNER|BDR_OUTER)] != -1 ? 1 : 0)
+ (LTRBOuterMono[uType & (BDR_INNER|BDR_OUTER)] != -1 ? 1 : 0); + (LTRBOuterMono[uType & (BDR_INNER|BDR_OUTER)] != -1 ? 1 : 0);
if(uFlags & BF_LEFT) if (uFlags & BF_LEFT)
InnerRect.left += add; InnerRect.left += add;
if(uFlags & BF_RIGHT) if (uFlags & BF_RIGHT)
InnerRect.right -= add; InnerRect.right -= add;
if(uFlags & BF_TOP) if (uFlags & BF_TOP)
InnerRect.top += add; InnerRect.top += add;
if(uFlags & BF_BOTTOM) if (uFlags & BF_BOTTOM)
InnerRect.bottom -= add; InnerRect.bottom -= add;
if(uFlags & BF_ADJUST) if (uFlags & BF_ADJUST)
*rc = InnerRect; *rc = InnerRect;
} }
@ -198,7 +198,7 @@ static BOOL
MyDrawFrameButton(HDC hdc, LPRECT rc, UINT uState, COLOR_SCHEME *scheme) MyDrawFrameButton(HDC hdc, LPRECT rc, UINT uState, COLOR_SCHEME *scheme)
{ {
UINT edge; UINT edge;
if(uState & (DFCS_PUSHED | DFCS_CHECKED | DFCS_FLAT)) if (uState & (DFCS_PUSHED | DFCS_CHECKED | DFCS_FLAT))
edge = EDGE_SUNKEN; edge = EDGE_SUNKEN;
else else
edge = EDGE_RAISED; edge = EDGE_RAISED;
@ -220,7 +220,7 @@ MyMakeSquareRect(LPRECT src, LPRECT dst)
dst->top += (Height-Width)/2; dst->top += (Height-Width)/2;
dst->bottom = dst->top + SmallDiam; dst->bottom = dst->top + SmallDiam;
} }
else if(Width > Height) /* SmallDiam == Height */ else if (Width > Height) /* SmallDiam == Height */
{ {
dst->left += (Width-Height)/2; dst->left += (Width-Height)/2;
dst->right = dst->left + SmallDiam; dst->right = dst->left + SmallDiam;
@ -259,13 +259,13 @@ MyDrawFrameCaption(HDC dc, LPRECT r, UINT uFlags, COLOR_SCHEME *scheme)
return FALSE; return FALSE;
} }
MyIntDrawRectEdge(dc, r, (uFlags & DFCS_PUSHED) ? EDGE_SUNKEN : EDGE_RAISED, BF_RECT | BF_MIDDLE | BF_SOFT, scheme); MyIntDrawRectEdge(dc, r, (uFlags & DFCS_PUSHED) ? EDGE_SUNKEN : EDGE_RAISED, BF_RECT | BF_MIDDLE | BF_SOFT, scheme);
ZeroMemory(&lf, sizeof(LOGFONT)); ZeroMemory(&lf, sizeof(lf));
MyMakeSquareRect(r, &myr); MyMakeSquareRect(r, &myr);
myr.left += 1; myr.left += 1;
myr.top += 1; myr.top += 1;
myr.right -= 1; myr.right -= 1;
myr.bottom -= 1; myr.bottom -= 1;
if(uFlags & DFCS_PUSHED) if (uFlags & DFCS_PUSHED)
OffsetRect(&myr,1,1); OffsetRect(&myr,1,1);
lf.lfHeight = myr.bottom - myr.top; lf.lfHeight = myr.bottom - myr.top;
lf.lfWidth = 0; lf.lfWidth = 0;
@ -279,7 +279,7 @@ MyDrawFrameCaption(HDC dc, LPRECT r, UINT uFlags, COLOR_SCHEME *scheme)
bkmode = GetBkMode(dc); bkmode = GetBkMode(dc);
/* Set color and drawing mode */ /* Set color and drawing mode */
SetBkMode(dc, TRANSPARENT); SetBkMode(dc, TRANSPARENT);
if(uFlags & DFCS_INACTIVE) if (uFlags & DFCS_INACTIVE)
{ {
/* Draw shadow */ /* Draw shadow */
SetTextColor(dc, scheme->crColor[COLOR_BTNHIGHLIGHT]); SetTextColor(dc, scheme->crColor[COLOR_BTNHIGHLIGHT]);
@ -330,13 +330,13 @@ MyDrawFrameScroll(HDC dc, LPRECT r, UINT uFlags, COLOR_SCHEME *scheme)
return FALSE; return FALSE;
} }
MyIntDrawRectEdge(dc, r, (uFlags & DFCS_PUSHED) ? EDGE_SUNKEN : EDGE_RAISED, (uFlags&DFCS_FLAT) | BF_MIDDLE | BF_RECT, scheme); MyIntDrawRectEdge(dc, r, (uFlags & DFCS_PUSHED) ? EDGE_SUNKEN : EDGE_RAISED, (uFlags&DFCS_FLAT) | BF_MIDDLE | BF_RECT, scheme);
ZeroMemory(&lf, sizeof(LOGFONT)); ZeroMemory(&lf, sizeof(lf));
MyMakeSquareRect(r, &myr); MyMakeSquareRect(r, &myr);
myr.left += 1; myr.left += 1;
myr.top += 1; myr.top += 1;
myr.right -= 1; myr.right -= 1;
myr.bottom -= 1; myr.bottom -= 1;
if(uFlags & DFCS_PUSHED) if (uFlags & DFCS_PUSHED)
OffsetRect(&myr,1,1); OffsetRect(&myr,1,1);
lf.lfHeight = myr.bottom - myr.top; lf.lfHeight = myr.bottom - myr.top;
lf.lfWidth = 0; lf.lfWidth = 0;
@ -350,7 +350,7 @@ MyDrawFrameScroll(HDC dc, LPRECT r, UINT uFlags, COLOR_SCHEME *scheme)
bkmode = GetBkMode(dc); bkmode = GetBkMode(dc);
/* Set color and drawing mode */ /* Set color and drawing mode */
SetBkMode(dc, TRANSPARENT); SetBkMode(dc, TRANSPARENT);
if(uFlags & DFCS_INACTIVE) if (uFlags & DFCS_INACTIVE)
{ {
/* Draw shadow */ /* Draw shadow */
SetTextColor(dc, scheme->crColor[COLOR_BTNHIGHLIGHT]); SetTextColor(dc, scheme->crColor[COLOR_BTNHIGHLIGHT]);
@ -554,7 +554,7 @@ MyDrawMenuBarTemp(HWND Wnd, HDC DC, LPRECT Rect, HMENU Menu, HFONT Font, COLOR_S
bkgnd = (flat_menu ? COLOR_MENUBAR : COLOR_MENU); bkgnd = (flat_menu ? COLOR_MENUBAR : COLOR_MENU);
x = Rect->left; x = Rect->left;
hFontOld = SelectObject(DC, Font); hFontOld = SelectObject(DC, Font);
for(i = 0; i < 3; i++) for (i = 0; i < 3; i++)
{ {
GetMenuStringW(Menu, i, Text, 128, MF_BYPOSITION); GetMenuStringW(Menu, i, Text, 128, MF_BYPOSITION);

View file

@ -698,7 +698,7 @@ MonSelGetMonitorFont(IN OUT PMONITORSELWND infoPtr,
hFont = infoPtr->Monitors[Index].hFont; hFont = infoPtr->Monitors[Index].hFont;
if (hFont == NULL && if (hFont == NULL &&
GetObject(infoPtr->hFont, GetObject(infoPtr->hFont,
sizeof(LOGFONT), sizeof(lf),
&lf) != 0) &lf) != 0)
{ {
rcsize.cx = infoPtr->Monitors[Index].rc.right - infoPtr->Monitors[Index].rc.left - rcsize.cx = infoPtr->Monitors[Index].rc.right - infoPtr->Monitors[Index].rc.left -
@ -1580,9 +1580,9 @@ MonitorSelWndProc(IN HWND hwnd,
case WM_CREATE: case WM_CREATE:
{ {
infoPtr = (PMONITORSELWND) HeapAlloc(GetProcessHeap(), infoPtr = (PMONITORSELWND)HeapAlloc(GetProcessHeap(),
0, 0,
sizeof(MONITORSELWND)); sizeof(MONITORSELWND));
if (infoPtr == NULL) if (infoPtr == NULL)
{ {
Ret = (LRESULT)-1; Ret = (LRESULT)-1;

View file

@ -49,7 +49,7 @@ static int load_string(HINSTANCE hModule, UINT resId, LPWSTR pwszBuffer, INT cMa
* *
* @implemented * @implemented
*/ */
LONG LONG
RegLoadMUIStringW(IN HKEY hKey, RegLoadMUIStringW(IN HKEY hKey,
IN LPCWSTR pszValue OPTIONAL, IN LPCWSTR pszValue OPTIONAL,
OUT LPWSTR pszOutBuf, OUT LPWSTR pszOutBuf,
@ -65,7 +65,7 @@ RegLoadMUIStringW(IN HKEY hKey,
/* Parameter sanity checks. */ /* Parameter sanity checks. */
if (!hKey || !pszOutBuf) if (!hKey || !pszOutBuf)
return ERROR_INVALID_PARAMETER; return ERROR_INVALID_PARAMETER;
if (pszDirectory && *pszDirectory) if (pszDirectory && *pszDirectory)
{ {
//FIXME("BaseDir parameter not yet supported!\n"); //FIXME("BaseDir parameter not yet supported!\n");

View file

@ -260,7 +260,7 @@ OnPaint(HWND hwnd, PPREVIEW_DATA pPreviewData)
hdc = BeginPaint(hwnd, &ps); hdc = BeginPaint(hwnd, &ps);
if(pPreviewData->hdcPreview) if (pPreviewData->hdcPreview)
{ {
BitBlt(hdc,0,0, pPreviewData->rcDesktop.right, pPreviewData->rcDesktop.bottom, pPreviewData->hdcPreview, 0,0, SRCCOPY); BitBlt(hdc,0,0, pPreviewData->rcDesktop.right, pPreviewData->rcDesktop.bottom, pPreviewData->hdcPreview, 0,0, SRCCOPY);
EndPaint(hwnd, &ps); EndPaint(hwnd, &ps);
@ -470,7 +470,7 @@ PreviewWndProc(HWND hwnd,
CalculateItemSize(pPreviewData); CalculateItemSize(pPreviewData);
InvalidateRect(hwnd, NULL, FALSE); InvalidateRect(hwnd, NULL, FALSE);
break; break;
case PVM_SETFONT: case PVM_SETFONT:
{ {
PLOGFONTW plfFont; PLOGFONTW plfFont;
@ -498,15 +498,15 @@ PreviewWndProc(HWND hwnd,
pPreviewData->Scheme.crColor[wParam] = lParam; pPreviewData->Scheme.crColor[wParam] = lParam;
switch(wParam) switch(wParam)
{ {
case COLOR_SCROLLBAR: case COLOR_SCROLLBAR:
DeleteObject(pPreviewData->hbrScrollbar); DeleteObject(pPreviewData->hbrScrollbar);
pPreviewData->hbrScrollbar = CreateSolidBrush(pPreviewData->Scheme.crColor[wParam]); pPreviewData->hbrScrollbar = CreateSolidBrush(pPreviewData->Scheme.crColor[wParam]);
break; break;
case COLOR_DESKTOP: case COLOR_DESKTOP:
DeleteObject(pPreviewData->hbrDesktop); DeleteObject(pPreviewData->hbrDesktop);
pPreviewData->hbrDesktop = CreateSolidBrush(pPreviewData->Scheme.crColor[wParam]); pPreviewData->hbrDesktop = CreateSolidBrush(pPreviewData->Scheme.crColor[wParam]);
break; break;
case COLOR_WINDOW: case COLOR_WINDOW:
DeleteObject(pPreviewData->hbrWindow); DeleteObject(pPreviewData->hbrWindow);
pPreviewData->hbrWindow = CreateSolidBrush(pPreviewData->Scheme.crColor[wParam]); pPreviewData->hbrWindow = CreateSolidBrush(pPreviewData->Scheme.crColor[wParam]);
break; break;
@ -540,7 +540,7 @@ RegisterPreviewControl(IN HINSTANCE hInstance)
{ {
WNDCLASSEX wc = {0}; WNDCLASSEX wc = {0};
wc.cbSize = sizeof(WNDCLASSEX); wc.cbSize = sizeof(wc);
wc.lpfnWndProc = PreviewWndProc; wc.lpfnWndProc = PreviewWndProc;
wc.hInstance = hInstance; wc.hInstance = hInstance;
wc.hCursor = LoadCursor(NULL, IDC_ARROW); wc.hCursor = LoadCursor(NULL, IDC_ARROW);

View file

@ -23,7 +23,7 @@
#define IDX_APPSPACE 16 #define IDX_APPSPACE 16
#define IDX_QUICKINFO 20 #define IDX_QUICKINFO 20
#define PVM_SETSIZE (WM_USER+1) #define PVM_SETSIZE (WM_USER+1)
#define PVM_GETSIZE (WM_USER+2) #define PVM_GETSIZE (WM_USER+2)
#define PVM_SETFONT (WM_USER+3) #define PVM_SETFONT (WM_USER+3)
#define PVM_GETFONT (WM_USER+4) #define PVM_GETFONT (WM_USER+4)

View file

@ -214,7 +214,7 @@ ScreensaverConfig(HWND hwndDlg, PDATA pData)
ZeroMemory(&si, sizeof(si)); ZeroMemory(&si, sizeof(si));
si.cb = sizeof(si); si.cb = sizeof(si);
ZeroMemory(&pi, sizeof(pi)); ZeroMemory(&pi, sizeof(pi));
if(CreateProcess(NULL, if (CreateProcess(NULL,
szCmdline, szCmdline,
NULL, NULL,
NULL, NULL,
@ -270,7 +270,7 @@ ScreensaverPreview(HWND hwndDlg, PDATA pData)
ZeroMemory(&si, sizeof(si)); ZeroMemory(&si, sizeof(si));
si.cb = sizeof(si); si.cb = sizeof(si);
ZeroMemory(&pi, sizeof(pi)); ZeroMemory(&pi, sizeof(pi));
if(CreateProcess(NULL, if (CreateProcess(NULL,
szCmdline, szCmdline,
NULL, NULL,
NULL, NULL,
@ -760,7 +760,7 @@ ScreenSaverPageProc(HWND hwndDlg,
case IDC_SCREENS_TESTSC: // Screensaver Preview case IDC_SCREENS_TESTSC: // Screensaver Preview
{ {
if(command == BN_CLICKED) if (command == BN_CLICKED)
{ {
ScreensaverPreview(hwndDlg, pData); ScreensaverPreview(hwndDlg, pData);
SetScreenSaverPreviewBox(hwndDlg, pData); SetScreenSaverPreviewBox(hwndDlg, pData);

View file

@ -101,7 +101,7 @@ GetPossibleSettings(IN LPCTSTR DeviceName, OUT DWORD* pSettingsCount, OUT PSETTI
DeleteDC(hDC); DeleteDC(hDC);
/* List all settings */ /* List all settings */
devmode.dmSize = (WORD)sizeof(DEVMODE); devmode.dmSize = (WORD)sizeof(devmode);
devmode.dmDriverExtra = 0; devmode.dmDriverExtra = 0;
if (!EnumDisplaySettingsEx(DeviceName, ENUM_CURRENT_SETTINGS, &devmode, dwFlags)) if (!EnumDisplaySettingsEx(DeviceName, ENUM_CURRENT_SETTINGS, &devmode, dwFlags))
@ -319,7 +319,7 @@ OnInitDialog(IN HWND hwndDlg)
/* Get video cards list */ /* Get video cards list */
pData->DisplayDeviceList = NULL; pData->DisplayDeviceList = NULL;
displayDevice.cb = (DWORD)sizeof(DISPLAY_DEVICE); displayDevice.cb = sizeof(displayDevice);
while (EnumDisplayDevices(NULL, iDevNum, &displayDevice, 0x1)) while (EnumDisplayDevices(NULL, iDevNum, &displayDevice, 0x1))
{ {
if ((displayDevice.StateFlags & DISPLAY_DEVICE_ATTACHED_TO_DESKTOP) != 0) if ((displayDevice.StateFlags & DISPLAY_DEVICE_ATTACHED_TO_DESKTOP) != 0)
@ -393,7 +393,7 @@ OnInitDialog(IN HWND hwndDlg)
} }
/* Initialize the color spectrum bitmaps */ /* Initialize the color spectrum bitmaps */
for(i = 0; i < NUM_SPECTRUM_BITMAPS; i++) for (i = 0; i < NUM_SPECTRUM_BITMAPS; i++)
{ {
pData->hSpectrumBitmaps[i] = LoadImageW(hApplet, MAKEINTRESOURCEW(IDB_SPECTRUM_4 + i), IMAGE_BITMAP, 0, 0, LR_DEFAULTCOLOR); pData->hSpectrumBitmaps[i] = LoadImageW(hApplet, MAKEINTRESOURCEW(IDB_SPECTRUM_4 + i), IMAGE_BITMAP, 0, 0, LR_DEFAULTCOLOR);
@ -724,8 +724,8 @@ SettingsPageProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lPar
/* Apply new settings */ /* Apply new settings */
LONG rc; LONG rc;
DEVMODE devmode; DEVMODE devmode;
RtlZeroMemory(&devmode, sizeof(DEVMODE)); RtlZeroMemory(&devmode, sizeof(devmode));
devmode.dmSize = (WORD)sizeof(DEVMODE); devmode.dmSize = (WORD)sizeof(devmode);
devmode.dmPelsWidth = pData->CurrentDisplayDevice->CurrentSettings->dmPelsWidth; devmode.dmPelsWidth = pData->CurrentDisplayDevice->CurrentSettings->dmPelsWidth;
devmode.dmPelsHeight = pData->CurrentDisplayDevice->CurrentSettings->dmPelsHeight; devmode.dmPelsHeight = pData->CurrentDisplayDevice->CurrentSettings->dmPelsHeight;
devmode.dmBitsPerPel = pData->CurrentDisplayDevice->CurrentSettings->dmBitsPerPel; devmode.dmBitsPerPel = pData->CurrentDisplayDevice->CurrentSettings->dmBitsPerPel;

View file

@ -2,7 +2,7 @@
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS Display Control Panel * PROJECT: ReactOS Display Control Panel
* FILE: dll/cpl/desk/theme.c * FILE: dll/cpl/desk/theme.c
* PURPOSE: Handling themes * PURPOSE: Handling themes and visual effects
* *
* PROGRAMMERS: Katayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com> * PROGRAMMERS: Katayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
*/ */
@ -58,7 +58,7 @@ static const WCHAR *g_RegColorNames[NUM_COLORS] = {
/******************************************************************************/ /******************************************************************************/
VOID VOID
SchemeSetMetric(IN COLOR_SCHEME *scheme, int id, int value) SchemeSetMetric(IN COLOR_SCHEME *scheme, int id, int value)
{ {
switch(id) switch(id)
@ -78,7 +78,7 @@ SchemeSetMetric(IN COLOR_SCHEME *scheme, int id, int value)
} }
} }
int int
SchemeGetMetric(IN COLOR_SCHEME *scheme, int id) SchemeGetMetric(IN COLOR_SCHEME *scheme, int id)
{ {
switch (id) switch (id)
@ -86,12 +86,12 @@ SchemeGetMetric(IN COLOR_SCHEME *scheme, int id)
case SIZE_BORDER_WIDTH: return scheme->ncMetrics.iBorderWidth; case SIZE_BORDER_WIDTH: return scheme->ncMetrics.iBorderWidth;
case SIZE_SCROLL_WIDTH: return scheme->ncMetrics.iScrollWidth; case SIZE_SCROLL_WIDTH: return scheme->ncMetrics.iScrollWidth;
case SIZE_SCROLL_HEIGHT: return scheme->ncMetrics.iScrollHeight; case SIZE_SCROLL_HEIGHT: return scheme->ncMetrics.iScrollHeight;
case SIZE_CAPTION_WIDTH: return scheme->ncMetrics.iCaptionWidth; case SIZE_CAPTION_WIDTH: return scheme->ncMetrics.iCaptionWidth;
case SIZE_CAPTION_HEIGHT: return scheme->ncMetrics.iCaptionHeight; case SIZE_CAPTION_HEIGHT: return scheme->ncMetrics.iCaptionHeight;
case SIZE_SM_CAPTION_WIDTH: return scheme->ncMetrics.iSmCaptionWidth; case SIZE_SM_CAPTION_WIDTH: return scheme->ncMetrics.iSmCaptionWidth;
case SIZE_SM_CAPTION_HEIGHT: return scheme->ncMetrics.iSmCaptionHeight; case SIZE_SM_CAPTION_HEIGHT: return scheme->ncMetrics.iSmCaptionHeight;
case SIZE_MENU_WIDTH: return scheme->ncMetrics.iMenuWidth; case SIZE_MENU_WIDTH: return scheme->ncMetrics.iMenuWidth;
case SIZE_MENU_HEIGHT: return scheme->ncMetrics.iMenuHeight; case SIZE_MENU_HEIGHT: return scheme->ncMetrics.iMenuHeight;
case SIZE_ICON: return scheme->iIconSize; case SIZE_ICON: return scheme->iIconSize;
case SIZE_ICON_SPACE_X: return scheme->icMetrics.iHorzSpacing; case SIZE_ICON_SPACE_X: return scheme->icMetrics.iHorzSpacing;
case SIZE_ICON_SPACE_Y: return scheme->icMetrics.iVertSpacing; case SIZE_ICON_SPACE_Y: return scheme->icMetrics.iVertSpacing;
@ -132,38 +132,38 @@ LoadCurrentScheme(OUT COLOR_SCHEME *scheme)
/* Load non client metrics */ /* Load non client metrics */
scheme->ncMetrics.cbSize = sizeof(NONCLIENTMETRICSW); scheme->ncMetrics.cbSize = sizeof(NONCLIENTMETRICSW);
ret = SystemParametersInfoW(SPI_GETNONCLIENTMETRICS, ret = SystemParametersInfoW(SPI_GETNONCLIENTMETRICS,
sizeof(NONCLIENTMETRICSW), sizeof(NONCLIENTMETRICSW),
&scheme->ncMetrics, &scheme->ncMetrics,
0); 0);
if (!ret) return FALSE; if (!ret) return FALSE;
/* Load icon metrics */ /* Load icon metrics */
scheme->icMetrics.cbSize = sizeof(ICONMETRICSW); scheme->icMetrics.cbSize = sizeof(ICONMETRICSW);
ret = SystemParametersInfoW(SPI_GETICONMETRICS, ret = SystemParametersInfoW(SPI_GETICONMETRICS,
sizeof(ICONMETRICSW), sizeof(ICONMETRICSW),
&scheme->icMetrics, &scheme->icMetrics,
0); 0);
if (!ret) return FALSE; if (!ret) return FALSE;
/* Load flat menu style */ /* Load flat menu style */
ret = SystemParametersInfoW(SPI_GETFLATMENU, ret = SystemParametersInfoW(SPI_GETFLATMENU,
0, 0,
&scheme->bFlatMenus, &scheme->bFlatMenus,
0); 0);
if (!ret) return FALSE; if (!ret) return FALSE;
/* Effects */ /* Effects */
/* "Use the following transition effect for menus and tooltips" */ /* Use the following transition effect for menus and tooltips */
ret = SystemParametersInfoW(SPI_GETMENUANIMATION, ret = SystemParametersInfoW(SPI_GETMENUANIMATION,
0, 0,
&scheme->Effects.bMenuAnimation, &scheme->Effects.bMenuAnimation,
0); 0);
if (!ret) return FALSE; if (!ret) return FALSE;
ret = SystemParametersInfoW(SPI_GETMENUFADE, ret = SystemParametersInfoW(SPI_GETMENUFADE,
0, 0,
&scheme->Effects.bMenuFade, &scheme->Effects.bMenuFade,
0); 0);
if (!ret) return FALSE; if (!ret) return FALSE;
@ -174,16 +174,16 @@ LoadCurrentScheme(OUT COLOR_SCHEME *scheme)
scheme->Effects.bTooltipFade = scheme->Effects.bMenuFade; scheme->Effects.bTooltipFade = scheme->Effects.bMenuFade;
/* Show content of windows during dragging */ /* Show content of windows during dragging */
ret = SystemParametersInfoW(SPI_GETDRAGFULLWINDOWS, ret = SystemParametersInfoW(SPI_GETDRAGFULLWINDOWS,
0, 0,
&scheme->Effects.bDragFullWindows, &scheme->Effects.bDragFullWindows,
0); 0);
if (!ret) return FALSE; if (!ret) return FALSE;
/* "Hide underlined letters for keyboard navigation until I press the Alt key" */ /* Hide underlined letters for keyboard navigation until I press the Alt key */
ret = SystemParametersInfoW(SPI_GETKEYBOARDCUES, ret = SystemParametersInfoW(SPI_GETKEYBOARDCUES,
0, 0,
&scheme->Effects.bKeyboardCues, &scheme->Effects.bKeyboardCues,
0); 0);
if (!ret) return FALSE; if (!ret) return FALSE;
@ -199,7 +199,7 @@ LoadCurrentScheme(OUT COLOR_SCHEME *scheme)
} }
/* /*
* LoadSchemeFromReg: Populates the passed scheme with values retireved from registry * LoadSchemeFromReg: Populates the passed scheme with values retireved from registry
*/ */
BOOL BOOL
LoadSchemeFromReg(OUT COLOR_SCHEME *scheme, IN PTHEME_SELECTION pSelectedTheme) LoadSchemeFromReg(OUT COLOR_SCHEME *scheme, IN PTHEME_SELECTION pSelectedTheme)
@ -212,9 +212,9 @@ LoadSchemeFromReg(OUT COLOR_SCHEME *scheme, IN PTHEME_SELECTION pSelectedTheme)
BOOL Ret = TRUE; BOOL Ret = TRUE;
LONG result; LONG result;
wsprintf(strSchemeKey, L"%s\\%s\\Sizes\\%s", wsprintf(strSchemeKey, L"%s\\%s\\Sizes\\%s",
g_CPANewSchemes, g_CPANewSchemes,
pSelectedTheme->Color->StyleName, pSelectedTheme->Color->StyleName,
pSelectedTheme->Size->StyleName); pSelectedTheme->Size->StyleName);
result = RegOpenKeyW(HKEY_CURRENT_USER, strSchemeKey, &hkScheme); result = RegOpenKeyW(HKEY_CURRENT_USER, strSchemeKey, &hkScheme);
@ -226,11 +226,11 @@ LoadSchemeFromReg(OUT COLOR_SCHEME *scheme, IN PTHEME_SELECTION pSelectedTheme)
{ {
wsprintf(strValueName, L"Color #%d", i); wsprintf(strValueName, L"Color #%d", i);
dwLength = sizeof(COLORREF); dwLength = sizeof(COLORREF);
result = RegQueryValueExW(hkScheme, result = RegQueryValueExW(hkScheme,
strValueName, strValueName,
NULL, NULL,
&dwType, &dwType,
(LPBYTE)&scheme->crColor[i], (LPBYTE)&scheme->crColor[i],
&dwLength); &dwLength);
if (result != ERROR_SUCCESS || dwType != REG_DWORD) if (result != ERROR_SUCCESS || dwType != REG_DWORD)
{ {
@ -245,13 +245,13 @@ LoadSchemeFromReg(OUT COLOR_SCHEME *scheme, IN PTHEME_SELECTION pSelectedTheme)
wsprintf(strValueName, L"Font #%d", i); wsprintf(strValueName, L"Font #%d", i);
dwLength = sizeof(LOGFONT); dwLength = sizeof(LOGFONT);
result = RegQueryValueExW(hkScheme, result = RegQueryValueExW(hkScheme,
strValueName, strValueName,
NULL, NULL,
&dwType, &dwType,
(LPBYTE)lpfFont, (LPBYTE)lpfFont,
&dwLength); &dwLength);
if (result != ERROR_SUCCESS || dwType != REG_BINARY || if (result != ERROR_SUCCESS || dwType != REG_BINARY ||
dwLength != sizeof(LOGFONT)) dwLength != sizeof(LOGFONT))
{ {
/* Failed to read registry value */ /* Failed to read registry value */
@ -263,13 +263,13 @@ LoadSchemeFromReg(OUT COLOR_SCHEME *scheme, IN PTHEME_SELECTION pSelectedTheme)
{ {
wsprintf(strValueName, L"Size #%d", i); wsprintf(strValueName, L"Size #%d", i);
dwLength = sizeof(UINT64); dwLength = sizeof(UINT64);
result = RegQueryValueExW(hkScheme, result = RegQueryValueExW(hkScheme,
strValueName, strValueName,
NULL, NULL,
&dwType, &dwType,
(LPBYTE)&iSize, (LPBYTE)&iSize,
&dwLength); &dwLength);
if (result != ERROR_SUCCESS || dwType != REG_QWORD || if (result != ERROR_SUCCESS || dwType != REG_QWORD ||
dwLength != sizeof(UINT64)) dwLength != sizeof(UINT64))
{ {
/* Failed to read registry value, initialize with current setting for now */ /* Failed to read registry value, initialize with current setting for now */
@ -281,12 +281,12 @@ LoadSchemeFromReg(OUT COLOR_SCHEME *scheme, IN PTHEME_SELECTION pSelectedTheme)
} }
RegCloseKey(hkScheme); RegCloseKey(hkScheme);
return Ret; return Ret;
} }
/* /*
ApplyScheme: Applies the selected scheme and stores its id in the registry if needed * ApplyScheme: Applies the selected scheme and stores its id in the registry if needed
*/ */
VOID VOID
ApplyScheme(IN COLOR_SCHEME *scheme, IN PTHEME_SELECTION pSelectedTheme) ApplyScheme(IN COLOR_SCHEME *scheme, IN PTHEME_SELECTION pSelectedTheme)
@ -307,32 +307,32 @@ ApplyScheme(IN COLOR_SCHEME *scheme, IN PTHEME_SELECTION pSelectedTheme)
{ {
for (i = 0; i < NUM_COLORS; i++) for (i = 0; i < NUM_COLORS; i++)
{ {
wsprintf(clText, wsprintf(clText,
L"%d %d %d", L"%d %d %d",
GetRValue(scheme->crColor[i]), GetRValue(scheme->crColor[i]),
GetGValue(scheme->crColor[i]), GetGValue(scheme->crColor[i]),
GetBValue(scheme->crColor[i])); GetBValue(scheme->crColor[i]));
RegSetValueExW(hKey, RegSetValueExW(hKey,
g_RegColorNames[i], g_RegColorNames[i],
0, 0,
REG_SZ, REG_SZ,
(BYTE *)clText, (BYTE *)clText,
(lstrlen(clText) + 1) * sizeof(WCHAR)); (lstrlen(clText) + 1) * sizeof(WCHAR));
} }
RegCloseKey(hKey); RegCloseKey(hKey);
} }
/* Apply non client metrics */ /* Apply non client metrics */
SystemParametersInfoW(SPI_SETNONCLIENTMETRICS, SystemParametersInfoW(SPI_SETNONCLIENTMETRICS,
sizeof(NONCLIENTMETRICS), sizeof(NONCLIENTMETRICS),
&scheme->ncMetrics, &scheme->ncMetrics,
SPIF_UPDATEINIFILE | SPIF_SENDCHANGE); SPIF_UPDATEINIFILE | SPIF_SENDCHANGE);
/* Apply icon metrics */ /* Apply icon metrics */
SystemParametersInfoW(SPI_SETICONMETRICS, SystemParametersInfoW(SPI_SETICONMETRICS,
sizeof(ICONMETRICS), sizeof(ICONMETRICS),
&scheme->icMetrics, &scheme->icMetrics,
SPIF_UPDATEINIFILE | SPIF_SENDCHANGE); SPIF_UPDATEINIFILE | SPIF_SENDCHANGE);
/* Effects, save only when needed: */ /* Effects, save only when needed: */
@ -361,11 +361,11 @@ ApplyScheme(IN COLOR_SCHEME *scheme, IN PTHEME_SELECTION pSelectedTheme)
if (pSelectedTheme->Theme != NULL && pSelectedTheme->ThemeActive == FALSE) if (pSelectedTheme->Theme != NULL && pSelectedTheme->ThemeActive == FALSE)
{ {
StyleName = pSelectedTheme->Color->StyleName; StyleName = pSelectedTheme->Color->StyleName;
SHSetValueW(HKEY_CURRENT_USER, SHSetValueW(HKEY_CURRENT_USER,
g_CPANewSchemes, g_CPANewSchemes,
g_SelectedStyle, g_SelectedStyle,
REG_SZ, REG_SZ,
StyleName, StyleName,
(lstrlenW(StyleName) + 1) * sizeof(WCHAR)); (lstrlenW(StyleName) + 1) * sizeof(WCHAR));
} }
} }
@ -377,7 +377,7 @@ CreateTheme(LPCWSTR pszName, LPCWSTR pszDisplayName)
pTheme = (PTHEME) malloc(sizeof(THEME)); pTheme = (PTHEME) malloc(sizeof(THEME));
if (pTheme == NULL) return NULL; if (pTheme == NULL) return NULL;
pTheme->DisplayName = _wcsdup(pszDisplayName); pTheme->DisplayName = _wcsdup(pszDisplayName);
if (pTheme->DisplayName == NULL) if (pTheme->DisplayName == NULL)
{ {
@ -402,7 +402,7 @@ CreateTheme(LPCWSTR pszName, LPCWSTR pszDisplayName)
free(pTheme); free(pTheme);
return NULL; return NULL;
} }
return pTheme; return pTheme;
} }
@ -446,7 +446,7 @@ CleanupStyles(IN PTHEME_STYLE pStylesList)
if (pStyle->ChildStyle) CleanupStyles(pStyle->ChildStyle); if (pStyle->ChildStyle) CleanupStyles(pStyle->ChildStyle);
if (pStyle->DisplayName) free(pStyle->DisplayName); if (pStyle->DisplayName) free(pStyle->DisplayName);
if (pStyle->StyleName) free(pStyle->StyleName); if (pStyle->StyleName) free(pStyle->StyleName);
pStyleOld = pStyle; pStyleOld = pStyle;
pStyle = pStyle->NextStyle; pStyle = pStyle->NextStyle;
free(pStyleOld); free(pStyleOld);
@ -472,7 +472,7 @@ CleanupThemes(IN PTHEME pThemeList)
} }
} }
static PTHEME_STYLE static PTHEME_STYLE
FindStyle(IN PTHEME_STYLE pStylesList, IN PCWSTR StyleName) FindStyle(IN PTHEME_STYLE pStylesList, IN PCWSTR StyleName)
{ {
PTHEME_STYLE pStyle; PTHEME_STYLE pStyle;
@ -492,7 +492,7 @@ FindStyle(IN PTHEME_STYLE pStylesList, IN PCWSTR StyleName)
/* /*
* LoadSchemeSizes: Returns a list of sizes from the registry key of a scheme * LoadSchemeSizes: Returns a list of sizes from the registry key of a scheme
*/ */
static PTHEME_STYLE static PTHEME_STYLE
LoadSchemeSizes(IN HKEY hkScheme) LoadSchemeSizes(IN HKEY hkScheme)
{ {
HKEY hkSizes, hkSize; HKEY hkSizes, hkSize;
@ -511,25 +511,25 @@ LoadSchemeSizes(IN HKEY hkScheme)
Result = RegOpenKeyW(hkSizes, wstrSizeName, &hkSize); Result = RegOpenKeyW(hkSizes, wstrSizeName, &hkSize);
if (Result != ERROR_SUCCESS) continue; if (Result != ERROR_SUCCESS) continue;
Result = RegLoadMUIStringW(hkSize, Result = RegLoadMUIStringW(hkSize,
L"DisplayName", L"DisplayName",
wstrDisplayName, wstrDisplayName,
sizeof(wstrDisplayName), sizeof(wstrDisplayName),
NULL, NULL,
0, 0,
NULL); NULL);
if (Result != ERROR_SUCCESS) if (Result != ERROR_SUCCESS)
{ {
Result = RegLoadMUIStringW(hkSize, Result = RegLoadMUIStringW(hkSize,
L"LegacyName", L"LegacyName",
wstrDisplayName, wstrDisplayName,
sizeof(wstrDisplayName), sizeof(wstrDisplayName),
NULL, NULL,
0, 0,
NULL); NULL);
} }
if (Result == ERROR_SUCCESS) if (Result == ERROR_SUCCESS)
pCurrentStyle = CreateStyle(wstrSizeName, wstrDisplayName); pCurrentStyle = CreateStyle(wstrSizeName, wstrDisplayName);
else else
@ -549,9 +549,9 @@ LoadSchemeSizes(IN HKEY hkScheme)
} }
/* /*
LoadClassicColorSchemes: Returns a list of classic theme colours from the registry key of a scheme * LoadClassicColorSchemes: Returns a list of classic theme colours from the registry key of a scheme
*/ */
static THEME_STYLE* static THEME_STYLE*
LoadClassicColorSchemes(VOID) LoadClassicColorSchemes(VOID)
{ {
INT Result; INT Result;
@ -570,22 +570,22 @@ LoadClassicColorSchemes(VOID)
Result = RegOpenKeyW(hkNewSchemes, wstrStyleName, &hkScheme); Result = RegOpenKeyW(hkNewSchemes, wstrStyleName, &hkScheme);
if (Result != ERROR_SUCCESS) continue; if (Result != ERROR_SUCCESS) continue;
Result = RegLoadMUIStringW(hkScheme, Result = RegLoadMUIStringW(hkScheme,
L"DisplayName", L"DisplayName",
wstrDisplayName, wstrDisplayName,
sizeof(wstrDisplayName), sizeof(wstrDisplayName),
NULL, NULL,
0, 0,
NULL); NULL);
if (Result != ERROR_SUCCESS) if (Result != ERROR_SUCCESS)
{ {
Result = RegLoadMUIStringW(hkScheme, Result = RegLoadMUIStringW(hkScheme,
L"LegacyName", L"LegacyName",
wstrDisplayName, wstrDisplayName,
sizeof(wstrDisplayName), sizeof(wstrDisplayName),
NULL, NULL,
0, 0,
NULL); NULL);
} }
@ -613,7 +613,7 @@ LoadClassicColorSchemes(VOID)
typedef HRESULT (WINAPI *ENUMTHEMESTYLE) (LPCWSTR, LPWSTR, DWORD, PTHEMENAMES); typedef HRESULT (WINAPI *ENUMTHEMESTYLE) (LPCWSTR, LPWSTR, DWORD, PTHEMENAMES);
static THEME_STYLE* static THEME_STYLE*
EnumThemeStyles(IN LPCWSTR pszThemeFileName, IN ENUMTHEMESTYLE pfnEnumTheme) EnumThemeStyles(IN LPCWSTR pszThemeFileName, IN ENUMTHEMESTYLE pfnEnumTheme)
{ {
DWORD index = 0; DWORD index = 0;
@ -634,11 +634,11 @@ EnumThemeStyles(IN LPCWSTR pszThemeFileName, IN ENUMTHEMESTYLE pfnEnumTheme)
return List; return List;
} }
BOOL CALLBACK BOOL CALLBACK
EnumThemeProc(IN LPVOID lpReserved, EnumThemeProc(IN LPVOID lpReserved,
IN LPCWSTR pszThemeFileName, IN LPCWSTR pszThemeFileName,
IN LPCWSTR pszThemeName, IN LPCWSTR pszThemeName,
IN LPCWSTR pszToolTip, IN LPCWSTR pszToolTip,
IN LPVOID lpReserved2, IN LPVOID lpReserved2,
IN OUT LPVOID lpData) IN OUT LPVOID lpData)
{ {
@ -663,10 +663,10 @@ EnumThemeProc(IN LPVOID lpReserved,
return TRUE; return TRUE;
} }
/* /*
LoadThemes: Returns a list that contains tha classic theme and * LoadThemes: Returns a list that contains tha classic theme and
the visual styles of the system * the visual styles of the system
*/ */
PTHEME PTHEME
LoadThemes() LoadThemes()
{ {
@ -705,9 +705,9 @@ LoadThemes()
return pClassicTheme; return pClassicTheme;
} }
/* /*
* GetActiveTheme: Gets the active theme and populates pSelectedTheme * GetActiveTheme: Gets the active theme and populates pSelectedTheme
* with entries from the list of loaded themes * with entries from the list of loaded themes
*/ */
BOOL BOOL
GetActiveTheme(IN PTHEME pThemeList, OUT PTHEME_SELECTION pSelectedTheme) GetActiveTheme(IN PTHEME pThemeList, OUT PTHEME_SELECTION pSelectedTheme)
@ -717,21 +717,21 @@ GetActiveTheme(IN PTHEME pThemeList, OUT PTHEME_SELECTION pSelectedTheme)
WCHAR szSizeBuff[MAX_PATH]; WCHAR szSizeBuff[MAX_PATH];
PTHEME pTheme; PTHEME pTheme;
HRESULT hret; HRESULT hret;
ZeroMemory(pSelectedTheme, sizeof(THEME_SELECTION)); ZeroMemory(pSelectedTheme, sizeof(THEME_SELECTION));
/* Retrieve the name of the current theme */ /* Retrieve the name of the current theme */
hret = GetCurrentThemeName(szThemeFileName, hret = GetCurrentThemeName(szThemeFileName,
MAX_PATH, MAX_PATH,
szColorBuff, szColorBuff,
MAX_PATH, MAX_PATH,
szSizeBuff, szSizeBuff,
MAX_PATH); MAX_PATH);
if (FAILED(hret)) return FALSE; if (FAILED(hret)) return FALSE;
for (pTheme = pThemeList; pTheme; pTheme = pTheme->NextTheme) for (pTheme = pThemeList; pTheme; pTheme = pTheme->NextTheme)
{ {
if(pTheme->ThemeFileName && if (pTheme->ThemeFileName &&
_wcsicmp(pTheme->ThemeFileName, szThemeFileName) == 0) _wcsicmp(pTheme->ThemeFileName, szThemeFileName) == 0)
{ {
break; break;
@ -748,10 +748,10 @@ GetActiveTheme(IN PTHEME pThemeList, OUT PTHEME_SELECTION pSelectedTheme)
return TRUE; return TRUE;
} }
/* /*
GetActiveTheme: Gets the active classic theme and populates pSelectedTheme * GetActiveTheme: Gets the active classic theme and populates pSelectedTheme
with entries from the list of loaded themes * with entries from the list of loaded themes
*/ */
BOOL BOOL
GetActiveClassicTheme(IN PTHEME pThemeList, OUT PTHEME_SELECTION pSelectedTheme) GetActiveClassicTheme(IN PTHEME pThemeList, OUT PTHEME_SELECTION pSelectedTheme)
{ {
@ -762,7 +762,7 @@ GetActiveClassicTheme(IN PTHEME pThemeList, OUT PTHEME_SELECTION pSelectedTheme)
PTHEME_STYLE pCurrentStyle, pCurrentSize; PTHEME_STYLE pCurrentStyle, pCurrentSize;
ZeroMemory(pSelectedTheme, sizeof(THEME_SELECTION)); ZeroMemory(pSelectedTheme, sizeof(THEME_SELECTION));
/* Assume failure */ /* Assume failure */
szSelectedClassicScheme[0] = 0; szSelectedClassicScheme[0] = 0;
szSelectedClassicSize[0] = 0; szSelectedClassicSize[0] = 0;
@ -772,7 +772,7 @@ GetActiveClassicTheme(IN PTHEME pThemeList, OUT PTHEME_SELECTION pSelectedTheme)
dwType = REG_SZ; dwType = REG_SZ;
dwDisplayNameLength = sizeof(szSelectedClassicScheme); dwDisplayNameLength = sizeof(szSelectedClassicScheme);
Result = RegQueryValueEx(hkNewSchemes, L"SelectedStyle", NULL, &dwType, Result = RegQueryValueEx(hkNewSchemes, L"SelectedStyle", NULL, &dwType,
(LPBYTE)&szSelectedClassicScheme, &dwDisplayNameLength); (LPBYTE)&szSelectedClassicScheme, &dwDisplayNameLength);
if (Result == ERROR_SUCCESS) if (Result == ERROR_SUCCESS)
{ {
@ -802,10 +802,10 @@ ActivateTheme(IN PTHEME_SELECTION pSelectedTheme)
if (pSelectedTheme->ThemeActive) if (pSelectedTheme->ThemeActive)
{ {
hret = OpenThemeFile(pSelectedTheme->Theme->ThemeFileName, hret = OpenThemeFile(pSelectedTheme->Theme->ThemeFileName,
pSelectedTheme->Color->StyleName, pSelectedTheme->Color->StyleName,
pSelectedTheme->Size->StyleName, pSelectedTheme->Size->StyleName,
&hThemeFile, &hThemeFile,
0); 0);
if (!SUCCEEDED(hret)) return FALSE; if (!SUCCEEDED(hret)) return FALSE;
@ -829,14 +829,14 @@ LoadSchemeFromTheme(OUT PCOLOR_SCHEME scheme, IN PTHEME_SELECTION pSelectedTheme
HTHEME hTheme; HTHEME hTheme;
int i; int i;
hret = OpenThemeFile(pSelectedTheme->Theme->ThemeFileName, hret = OpenThemeFile(pSelectedTheme->Theme->ThemeFileName,
pSelectedTheme->Color->StyleName, pSelectedTheme->Color->StyleName,
pSelectedTheme->Size->StyleName, pSelectedTheme->Size->StyleName,
&hThemeFile, &hThemeFile,
0); 0);
if (!SUCCEEDED(hret)) return FALSE; if (!SUCCEEDED(hret)) return FALSE;
hTheme = OpenThemeDataFromFile(hThemeFile, hCPLWindow, L"WINDOW", 0); hTheme = OpenThemeDataFromFile(hThemeFile, hCPLWindow, L"WINDOW", 0);
if (hTheme == NULL) return FALSE; if (hTheme == NULL) return FALSE;
@ -865,7 +865,7 @@ LoadSchemeFromTheme(OUT PCOLOR_SCHEME scheme, IN PTHEME_SELECTION pSelectedTheme
GetThemeSysFont(hTheme, TMT_STATUSFONT, &scheme->ncMetrics.lfStatusFont); GetThemeSysFont(hTheme, TMT_STATUSFONT, &scheme->ncMetrics.lfStatusFont);
GetThemeSysFont(hTheme, TMT_MSGBOXFONT, &scheme->ncMetrics.lfMessageFont); GetThemeSysFont(hTheme, TMT_MSGBOXFONT, &scheme->ncMetrics.lfMessageFont);
GetThemeSysFont(hTheme, TMT_ICONTITLEFONT, &scheme->icMetrics.lfFont); GetThemeSysFont(hTheme, TMT_ICONTITLEFONT, &scheme->icMetrics.lfFont);
CloseThemeData(hTheme); CloseThemeData(hTheme);
return TRUE; return TRUE;
@ -884,13 +884,13 @@ DrawThemePreview(IN HDC hdcMem, IN PCOLOR_SCHEME scheme, IN PTHEME_SELECTION pSe
InflateRect(prcWindow, -10, -10); InflateRect(prcWindow, -10, -10);
hres = DrawNCPreview(hdcMem, hres = DrawNCPreview(hdcMem,
DNCP_DRAW_ALL, DNCP_DRAW_ALL,
prcWindow, prcWindow,
pSelectedTheme->Theme->ThemeFileName, pSelectedTheme->Theme->ThemeFileName,
pSelectedTheme->Color->StyleName, pSelectedTheme->Color->StyleName,
pSelectedTheme->Size->StyleName, pSelectedTheme->Size->StyleName,
&scheme->ncMetrics, &scheme->ncMetrics,
scheme->crColor); scheme->crColor);
return SUCCEEDED(hres); return SUCCEEDED(hres);