Author: gedmurphy
Date: Wed Oct 6 14:13:00 2010
New Revision: 49017
URL:
http://svn.reactos.org/svn/reactos?rev=49017&view=rev
Log:
- Implement monitor bitmap support for the display dialog
- Fix incorrect codepage values
- Look for applets in windows dir as well as system dir
- Patch by Carlo Bramix
See issue #3158 for more details.
Modified:
trunk/reactos/dll/cpl/desk/background.c
trunk/reactos/dll/cpl/desk/devsett.c
trunk/reactos/dll/cpl/desk/lang/bg-BG.rc
trunk/reactos/dll/cpl/desk/lang/cs-CZ.rc
trunk/reactos/dll/cpl/desk/lang/de-DE.rc
trunk/reactos/dll/cpl/desk/lang/el-GR.rc
trunk/reactos/dll/cpl/desk/lang/en-US.rc
trunk/reactos/dll/cpl/desk/lang/es-ES.rc
trunk/reactos/dll/cpl/desk/lang/fr-FR.rc
trunk/reactos/dll/cpl/desk/lang/hu-HU.rc
trunk/reactos/dll/cpl/desk/lang/id-ID.rc
trunk/reactos/dll/cpl/desk/lang/it-IT.rc
trunk/reactos/dll/cpl/desk/lang/ja-JP.rc
trunk/reactos/dll/cpl/desk/lang/nl-NL.rc
trunk/reactos/dll/cpl/desk/lang/no-NO.rc
trunk/reactos/dll/cpl/desk/lang/pl-PL.rc
trunk/reactos/dll/cpl/desk/lang/ro-RO.rc
trunk/reactos/dll/cpl/desk/lang/ru-RU.rc
trunk/reactos/dll/cpl/desk/lang/sk-SK.rc
trunk/reactos/dll/cpl/desk/lang/sv-SE.rc
trunk/reactos/dll/cpl/desk/lang/uk-UA.rc
trunk/reactos/dll/cpl/desk/lang/zh-CN.rc
trunk/reactos/dll/cpl/desk/screensaver.c
Modified: trunk/reactos/dll/cpl/desk/background.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/background.c?…
==============================================================================
--- trunk/reactos/dll/cpl/desk/background.c [iso-8859-1] (original)
+++ trunk/reactos/dll/cpl/desk/background.c [iso-8859-1] Wed Oct 6 14:13:00 2010
@@ -16,6 +16,18 @@
#define PLACEMENT_CENTER 0
#define PLACEMENT_STRETCH 1
#define PLACEMENT_TILE 2
+
+/* The values in these macros are dependant on the
+ * layout of the monitor image and they must be adjusted
+ * if that image will be changed.
+ */
+#define MONITOR_LEFT 18
+#define MONITOR_TOP 18
+#define MONITOR_RIGHT 168
+#define MONITOR_BOTTOM 128
+
+#define MONITOR_WIDTH (MONITOR_RIGHT-MONITOR_LEFT)
+#define MONITOR_HEIGHT (MONITOR_BOTTOM-MONITOR_TOP)
typedef struct
{
@@ -303,7 +315,7 @@
RegCloseKey(regKey);
- pData->hBitmap = (HBITMAP) LoadImage(hApplet, MAKEINTRESOURCE(IDC_MONITOR),
IMAGE_BITMAP, 0, 0, LR_LOADTRANSPARENT);
+ pData->hBitmap = (HBITMAP) LoadImage(hApplet, MAKEINTRESOURCE(IDC_MONITOR),
IMAGE_BITMAP, 0, 0, LR_DEFAULTCOLOR);
if (pData->hBitmap != NULL)
{
GetObject(pData->hBitmap, sizeof(BITMAP), &bitmap);
@@ -515,93 +527,139 @@
float scaleY;
int scaledWidth;
int scaledHeight;
- int posX;
- int posY;
+ int posX, desX;
+ int posY, desY;
HBRUSH hBrush;
int x;
int y;
+ HDC hDC;
+ HGDIOBJ hOldObj;
+ RECT rcItem = {
+ MONITOR_LEFT,
+ MONITOR_TOP,
+ MONITOR_RIGHT,
+ MONITOR_BOTTOM
+ };
+
+ hDC = CreateCompatibleDC(draw->hDC);
+ hOldObj = SelectObject(hDC, pData->hBitmap);
if (pData->backgroundItems[pData->backgroundSelection].bWallpaper == FALSE)
{
/* update desktop background color image */
hBrush = CreateSolidBrush(g_GlobalData.desktop_color);
- FillRect(draw->hDC, &draw->rcItem, hBrush);
+ FillRect(hDC, &rcItem, hBrush);
DeleteObject(hBrush);
- return;
- }
-
- if (pData->pWallpaperBitmap == NULL)
- return;
-
- scaleX = ((float)GetSystemMetrics(SM_CXSCREEN) - 1) / (float)draw->rcItem.right;
- scaleY = ((float)GetSystemMetrics(SM_CYSCREEN) - 1) / (float)draw->rcItem.bottom;
-
- scaledWidth = pData->pWallpaperBitmap->width / scaleX;
- scaledHeight = pData->pWallpaperBitmap->height / scaleY;
-
- posX = (draw->rcItem.right / 2) - (scaledWidth / 2);
- posY = (draw->rcItem.bottom / 2) - (scaledHeight / 2);
-
- FillRect(draw->hDC, &draw->rcItem, GetSysColorBrush(COLOR_BACKGROUND));
-
- SetStretchBltMode(draw->hDC, COLORONCOLOR);
-
- switch (pData->placementSelection)
- {
- case PLACEMENT_CENTER:
- StretchDIBits(draw->hDC,
- posX,
- posY,
- scaledWidth,
- scaledHeight,
- 0,
- 0,
- pData->pWallpaperBitmap->width,
- pData->pWallpaperBitmap->height,
- pData->pWallpaperBitmap->bits,
- pData->pWallpaperBitmap->info,
- DIB_RGB_COLORS,
- SRCCOPY);
- break;
-
- case PLACEMENT_STRETCH:
- StretchDIBits(draw->hDC,
- 0,
- 0,
- draw->rcItem.right,
- draw->rcItem.bottom,
- 0,
- 0,
- pData->pWallpaperBitmap->width,
- pData->pWallpaperBitmap->height,
- pData->pWallpaperBitmap->bits,
- pData->pWallpaperBitmap->info,
- DIB_RGB_COLORS,
- SRCCOPY);
- break;
-
- case PLACEMENT_TILE:
- for (y = 0; y < draw->rcItem.bottom; y += scaledHeight)
- {
- for (x = 0; x < draw->rcItem.right; x += scaledWidth)
+ }
+ else
+ if (pData->pWallpaperBitmap != NULL)
+ {
+ scaleX = ((float)GetSystemMetrics(SM_CXSCREEN) - 1) / (float)MONITOR_WIDTH;
+ scaleY = ((float)GetSystemMetrics(SM_CYSCREEN) - 1) / (float)MONITOR_HEIGHT;
+
+ scaledWidth = (int)(pData->pWallpaperBitmap->width / scaleX);
+ scaledHeight = (int)(pData->pWallpaperBitmap->height / scaleY);
+
+ FillRect(hDC, &rcItem, GetSysColorBrush(COLOR_BACKGROUND));
+
+ SetStretchBltMode(hDC, COLORONCOLOR);
+
+ switch (pData->placementSelection)
+ {
+ case PLACEMENT_CENTER:
+ posX = (MONITOR_WIDTH - scaledWidth + 1) / 2;
+ posY = (MONITOR_HEIGHT - scaledHeight + 1) / 2;
+ desX = 0;
+ desY = 0;
+
+ if (posX < 0) { desX = -posX / 2; posX = 0; }
+ if (posY < 0) { desY = -posY / 2; posY = 0; }
+
+ if (scaledWidth > MONITOR_WIDTH)
+ scaledWidth = MONITOR_WIDTH;
+
+ if (scaledHeight > MONITOR_HEIGHT)
+ scaledHeight = MONITOR_HEIGHT;
+
+ StretchDIBits(hDC,
+ MONITOR_LEFT+posX,
+ MONITOR_TOP+posY,
+ scaledWidth,
+ scaledHeight,
+ desX,
+ desY,
+ pData->pWallpaperBitmap->width - (int)(desX *
scaleX),
+ pData->pWallpaperBitmap->height - (int)(desY *
scaleY),
+ pData->pWallpaperBitmap->bits,
+ pData->pWallpaperBitmap->info,
+ DIB_RGB_COLORS,
+ SRCCOPY);
+ break;
+
+ case PLACEMENT_STRETCH:
+ StretchDIBits(hDC,
+ MONITOR_LEFT,
+ MONITOR_TOP,
+ MONITOR_WIDTH,
+ MONITOR_HEIGHT,
+ 0,
+ 0,
+ pData->pWallpaperBitmap->width,
+ pData->pWallpaperBitmap->height,
+ pData->pWallpaperBitmap->bits,
+ pData->pWallpaperBitmap->info,
+ DIB_RGB_COLORS,
+ SRCCOPY);
+ break;
+
+ case PLACEMENT_TILE:
+ for (y = 0; y < MONITOR_HEIGHT; y += scaledHeight)
{
- StretchDIBits(draw->hDC,
- x,
- y,
- scaledWidth,
- scaledHeight,
- 0,
- 0,
- pData->pWallpaperBitmap->width,
- pData->pWallpaperBitmap->height,
- pData->pWallpaperBitmap->bits,
- pData->pWallpaperBitmap->info,
- DIB_RGB_COLORS,
- SRCCOPY);
+ for (x = 0; x < MONITOR_WIDTH; x += scaledWidth)
+ {
+ if ((MONITOR_WIDTH-x) >= scaledWidth)
+ posX = scaledWidth;
+ else
+ posX = MONITOR_WIDTH-x;
+
+
+ if ((MONITOR_HEIGHT-y) >= scaledHeight)
+ posY = scaledHeight;
+ else
+ posY = MONITOR_HEIGHT-y;
+
+ StretchDIBits(hDC,
+ MONITOR_LEFT + x,
+ MONITOR_TOP + y,
+ posX,
+ posY,
+ 0,
+ 0,
+ pData->pWallpaperBitmap->width * posX /
scaledWidth,
+ pData->pWallpaperBitmap->height * posY /
scaledHeight,
+ pData->pWallpaperBitmap->bits,
+ pData->pWallpaperBitmap->info,
+ DIB_RGB_COLORS,
+ SRCCOPY);
+ }
+
}
- }
- break;
- }
+
+ break;
+ }
+ }
+
+ TransparentBlt(draw->hDC,
+ draw->rcItem.left, draw->rcItem.top,
+ draw->rcItem.right-draw->rcItem.left+1,
+ draw->rcItem.bottom-draw->rcItem.top+1,
+ hDC,
+ 0, 0,
+ pData->cxSource, pData->cySource,
+ 0xFF00FF);
+
+ SelectObject(hDC, hOldObj);
+ DeleteDC(hDC);
}
@@ -724,25 +782,6 @@
}
} break;
- case WM_PAINT:
- {
- PAINTSTRUCT ps;
- HDC hdc, hdcMem;
-
- hdc = BeginPaint(hwndDlg, &ps);
-
- hdcMem = CreateCompatibleDC(hdc);
- SelectObject(hdcMem, pData->hBitmap);
-/*
- TransparentBlt(hdc, 98, 0,
- pData->cxSource, pData->cySource, hdcMem, 0, 0,
- pData->cxSource, pData->cySource, 0xFF80FF);
-*/
- DeleteDC(hdcMem);
- EndPaint(hwndDlg, &ps);
- }
- break;
-
case WM_DRAWITEM:
{
LPDRAWITEMSTRUCT drawItem;
Modified: trunk/reactos/dll/cpl/desk/devsett.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/devsett.c?rev…
==============================================================================
--- trunk/reactos/dll/cpl/desk/devsett.c [iso-8859-1] (original)
+++ trunk/reactos/dll/cpl/desk/devsett.c [iso-8859-1] Wed Oct 6 14:13:00 2010
@@ -86,7 +86,7 @@
wcscpy(str,
pszSrc);
#else
- MultiByteToWideChar(CP_APC,
+ MultiByteToWideChar(CP_ACP,
0,
pszSrc,
-1,
Modified: trunk/reactos/dll/cpl/desk/lang/bg-BG.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/lang/bg-BG.rc…
==============================================================================
--- trunk/reactos/dll/cpl/desk/lang/bg-BG.rc [iso-8859-1] (original)
+++ trunk/reactos/dll/cpl/desk/lang/bg-BG.rc [iso-8859-1] Wed Oct 6 14:13:00 2010
@@ -8,7 +8,7 @@
FONT 8, "MS Shell Dlg"
BEGIN
CONTROL "", IDC_BACKGROUND_PREVIEW, "Static",
SS_OWNERDRAW,
- 70, 10, 105, 70,WS_EX_STATICEDGE
+ 70, 10, 105, 80, 0
CONTROL "",IDC_BACKGROUND_LIST,"SysListView32",LVS_REPORT
|
LVS_SINGLESEL | LVS_NOCOLUMNHEADER | LVS_SHAREIMAGELISTS |
LVS_SHOWSELALWAYS |
WS_BORDER | WS_TABSTOP, 8, 114, 174, 78
@@ -18,7 +18,7 @@
PUSHBUTTON "&Öâÿò...", IDC_COLOR_BUTTON, 188, 177, 50, 15
LTEXT "Ðàçïîëîæåíèå:", IDC_STATIC, 188, 138, 55, 9
COMBOBOX IDC_PLACEMENT_COMBO, 188, 149, 50, 54,
- CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
+ CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
END
Modified: trunk/reactos/dll/cpl/desk/lang/cs-CZ.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/lang/cs-CZ.rc…
==============================================================================
--- trunk/reactos/dll/cpl/desk/lang/cs-CZ.rc [iso-8859-1] (original)
+++ trunk/reactos/dll/cpl/desk/lang/cs-CZ.rc [iso-8859-1] Wed Oct 6 14:13:00 2010
@@ -12,7 +12,7 @@
FONT 8, "MS Shell Dlg"
BEGIN
CONTROL "",IDC_BACKGROUND_PREVIEW,"Static",SS_OWNERDRAW,
- 70, 10, 105, 70,WS_EX_STATICEDGE
+ 70, 10, 105, 80, 0
CONTROL "",IDC_BACKGROUND_LIST,"SysListView32",LVS_REPORT
|
LVS_SINGLESEL | LVS_NOCOLUMNHEADER | LVS_SHAREIMAGELISTS |
LVS_SHOWSELALWAYS |
WS_BORDER | WS_TABSTOP,7,99,173,71
@@ -22,7 +22,7 @@
PUSHBUTTON "&Barva...",IDC_COLOR_BUTTON,187,155,50,14
LTEXT "Umístìní:",IDC_STATIC,187,98,36,8
COMBOBOX IDC_PLACEMENT_COMBO,187,108,50,90,CBS_DROPDOWNLIST |
- CBS_SORT | WS_VSCROLL | WS_TABSTOP
+ WS_VSCROLL | WS_TABSTOP
END
Modified: trunk/reactos/dll/cpl/desk/lang/de-DE.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/lang/de-DE.rc…
==============================================================================
--- trunk/reactos/dll/cpl/desk/lang/de-DE.rc [iso-8859-1] (original)
+++ trunk/reactos/dll/cpl/desk/lang/de-DE.rc [iso-8859-1] Wed Oct 6 14:13:00 2010
@@ -6,7 +6,7 @@
FONT 8, "MS Shell Dlg"
BEGIN
CONTROL "", IDC_BACKGROUND_PREVIEW, "Static",
SS_OWNERDRAW,
- 70, 10, 105, 70, WS_EX_STATICEDGE
+ 70, 10, 105, 80, 0
CONTROL "", IDC_BACKGROUND_LIST, "SysListView32",
LVS_REPORT |
LVS_SINGLESEL | LVS_NOCOLUMNHEADER | LVS_SHAREIMAGELISTS |
LVS_SHOWSELALWAYS |
WS_BORDER | WS_TABSTOP, 8, 114, 174, 78
@@ -16,7 +16,7 @@
PUSHBUTTON "&Farbe...", IDC_COLOR_BUTTON, 188, 177, 55, 15
LTEXT "&Ausrichtung:", IDC_STATIC, 188, 140, 50, 9
COMBOBOX IDC_PLACEMENT_COMBO, 188, 149, 50, 54,
- CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
+ CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
END
IDD_SCREENSAVER DIALOGEX 0, 0, 246, 204
Modified: trunk/reactos/dll/cpl/desk/lang/el-GR.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/lang/el-GR.rc…
==============================================================================
--- trunk/reactos/dll/cpl/desk/lang/el-GR.rc [iso-8859-1] (original)
+++ trunk/reactos/dll/cpl/desk/lang/el-GR.rc [iso-8859-1] Wed Oct 6 14:13:00 2010
@@ -6,7 +6,7 @@
FONT 8, "MS Shell Dlg"
BEGIN
CONTROL "", IDC_BACKGROUND_PREVIEW, "Static",
SS_OWNERDRAW,
- 70, 10, 105, 70, WS_EX_STATICEDGE
+ 70, 10, 105, 80, 0
CONTROL "", IDC_BACKGROUND_LIST, "SysListView32",
LVS_REPORT |
LVS_SINGLESEL | LVS_NOCOLUMNHEADER | LVS_SHAREIMAGELISTS |
LVS_SHOWSELALWAYS |
WS_BORDER | WS_TABSTOP, 7, 99, 163, 71
@@ -16,7 +16,7 @@
PUSHBUTTON "&×ñþìá...", IDC_COLOR_BUTTON, 177, 155, 64, 14
LTEXT "ÈÝóç:", IDC_STATIC, 177, 98, 36, 8
COMBOBOX IDC_PLACEMENT_COMBO, 177, 108, 64, 90,
- CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
+ CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
END
IDD_SCREENSAVER DIALOGEX 0, 0, 246, 204
Modified: trunk/reactos/dll/cpl/desk/lang/en-US.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/lang/en-US.rc…
==============================================================================
--- trunk/reactos/dll/cpl/desk/lang/en-US.rc [iso-8859-1] (original)
+++ trunk/reactos/dll/cpl/desk/lang/en-US.rc [iso-8859-1] Wed Oct 6 14:13:00 2010
@@ -6,7 +6,7 @@
FONT 8, "MS Shell Dlg"
BEGIN
CONTROL "", IDC_BACKGROUND_PREVIEW, "Static",
SS_OWNERDRAW,
- 70, 10, 105, 70,WS_EX_STATICEDGE
+ 70, 10, 105, 80, 0
CONTROL "",IDC_BACKGROUND_LIST,"SysListView32",LVS_REPORT
|
LVS_SINGLESEL | LVS_NOCOLUMNHEADER | LVS_SHAREIMAGELISTS |
LVS_SHOWSELALWAYS |
WS_BORDER | WS_TABSTOP, 8, 114, 174, 78
@@ -16,7 +16,7 @@
PUSHBUTTON "&Color...", IDC_COLOR_BUTTON, 188, 177, 50, 15
LTEXT "Placement:", IDC_STATIC, 188, 138, 36, 9
COMBOBOX IDC_PLACEMENT_COMBO, 188, 149, 50, 54,
- CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
+ CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
END
IDD_SCREENSAVER DIALOGEX 0, 0, 246, 204
Modified: trunk/reactos/dll/cpl/desk/lang/es-ES.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/lang/es-ES.rc…
==============================================================================
--- trunk/reactos/dll/cpl/desk/lang/es-ES.rc [iso-8859-1] (original)
+++ trunk/reactos/dll/cpl/desk/lang/es-ES.rc [iso-8859-1] Wed Oct 6 14:13:00 2010
@@ -14,7 +14,7 @@
FONT 8, "MS Shell Dlg"
BEGIN
CONTROL "", IDC_BACKGROUND_PREVIEW, "Static",
SS_OWNERDRAW,
- 70, 10, 105, 70,WS_EX_STATICEDGE
+ 70, 10, 105, 80, 0
CONTROL "",IDC_BACKGROUND_LIST,"SysListView32",LVS_REPORT
|
LVS_SINGLESEL | LVS_NOCOLUMNHEADER | LVS_SHAREIMAGELISTS |
LVS_SHOWSELALWAYS |
WS_BORDER | WS_TABSTOP, 7, 99, 173, 71
@@ -24,7 +24,7 @@
PUSHBUTTON "C&olor...", IDC_COLOR_BUTTON, 187, 155, 50, 14
LTEXT "Po&sición", IDC_STATIC, 187, 98, 36, 8
COMBOBOX IDC_PLACEMENT_COMBO, 187, 108, 50, 90,
- CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
+ CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
END
IDD_SCREENSAVER DIALOGEX 0, 0, 246, 204
Modified: trunk/reactos/dll/cpl/desk/lang/fr-FR.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/lang/fr-FR.rc…
==============================================================================
--- trunk/reactos/dll/cpl/desk/lang/fr-FR.rc [iso-8859-1] (original)
+++ trunk/reactos/dll/cpl/desk/lang/fr-FR.rc [iso-8859-1] Wed Oct 6 14:13:00 2010
@@ -9,7 +9,7 @@
FONT 8, "MS Shell Dlg"
BEGIN
CONTROL "", IDC_BACKGROUND_PREVIEW,"Static",
SS_OWNERDRAW,
- 70, 10, 105, 70, WS_EX_STATICEDGE
+ 70, 10, 105, 80, 0
CONTROL "", IDC_BACKGROUND_LIST, "SysListView32",
LVS_REPORT |
LVS_SINGLESEL | LVS_NOCOLUMNHEADER | LVS_SHAREIMAGELISTS |
LVS_SHOWSELALWAYS |
WS_BORDER | WS_TABSTOP, 7, 99, 173, 71
@@ -19,7 +19,7 @@
PUSHBUTTON "&Couleur...",IDC_COLOR_BUTTON, 187, 155, 50, 14
LTEXT "Position :",IDC_STATIC, 187, 98, 36, 8
COMBOBOX IDC_PLACEMENT_COMBO, 187, 108, 50, 90,
- CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
+ CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
END
IDD_SCREENSAVER DIALOGEX 0, 0, 246, 204
Modified: trunk/reactos/dll/cpl/desk/lang/hu-HU.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/lang/hu-HU.rc…
==============================================================================
--- trunk/reactos/dll/cpl/desk/lang/hu-HU.rc [iso-8859-1] (original)
+++ trunk/reactos/dll/cpl/desk/lang/hu-HU.rc [iso-8859-1] Wed Oct 6 14:13:00 2010
@@ -7,7 +7,7 @@
FONT 8, "MS Shell Dlg"
BEGIN
CONTROL "", IDC_BACKGROUND_PREVIEW, "Static",
SS_OWNERDRAW,
- 70, 10, 105, 70, WS_EX_STATICEDGE
+ 70, 10, 105, 80, 0
CONTROL "", IDC_BACKGROUND_LIST, "SysListView32",
LVS_REPORT |
LVS_SINGLESEL | LVS_NOCOLUMNHEADER | LVS_SHAREIMAGELISTS |
LVS_SHOWSELALWAYS |
WS_BORDER | WS_TABSTOP, 7, 99, 173, 71
@@ -17,7 +17,7 @@
PUSHBUTTON "&Színek...", IDC_COLOR_BUTTON, 187, 155, 50, 14
LTEXT "Elrendezés:", IDC_STATIC, 187, 98, 36, 8
COMBOBOX IDC_PLACEMENT_COMBO, 187, 148, 50, 90,
- CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
+ CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
END
IDD_SCREENSAVER DIALOGEX 0, 0, 246, 204
Modified: trunk/reactos/dll/cpl/desk/lang/id-ID.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/lang/id-ID.rc…
==============================================================================
--- trunk/reactos/dll/cpl/desk/lang/id-ID.rc [iso-8859-1] (original)
+++ trunk/reactos/dll/cpl/desk/lang/id-ID.rc [iso-8859-1] Wed Oct 6 14:13:00 2010
@@ -6,7 +6,7 @@
FONT 8, "MS Shell Dlg"
BEGIN
CONTROL "", IDC_BACKGROUND_PREVIEW, "Static",
SS_OWNERDRAW,
- 70, 10, 105, 70,WS_EX_STATICEDGE
+ 70, 10, 105, 80, 0
CONTROL "",IDC_BACKGROUND_LIST,"SysListView32",LVS_REPORT
|
LVS_SINGLESEL | LVS_NOCOLUMNHEADER | LVS_SHAREIMAGELISTS |
LVS_SHOWSELALWAYS |
WS_BORDER | WS_TABSTOP, 8, 114, 174, 78
@@ -16,7 +16,7 @@
PUSHBUTTON "&Warna...", IDC_COLOR_BUTTON, 188, 177, 50, 15
LTEXT "Penempatan:", IDC_STATIC, 188, 138, 36, 9
COMBOBOX IDC_PLACEMENT_COMBO, 188, 149, 50, 54,
- CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
+ CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
END
IDD_SCREENSAVER DIALOGEX 0, 0, 246, 204
Modified: trunk/reactos/dll/cpl/desk/lang/it-IT.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/lang/it-IT.rc…
==============================================================================
--- trunk/reactos/dll/cpl/desk/lang/it-IT.rc [iso-8859-1] (original)
+++ trunk/reactos/dll/cpl/desk/lang/it-IT.rc [iso-8859-1] Wed Oct 6 14:13:00 2010
@@ -6,7 +6,7 @@
FONT 8, "MS Shell Dlg"
BEGIN
CONTROL "", IDC_BACKGROUND_PREVIEW, "Static",
SS_OWNERDRAW,
- 70, 10, 105, 70, WS_EX_STATICEDGE
+ 70, 10, 105, 80, 0
CONTROL "", IDC_BACKGROUND_LIST, "SysListView32",
LVS_REPORT |
LVS_SINGLESEL | LVS_NOCOLUMNHEADER | LVS_SHAREIMAGELISTS |
LVS_SHOWSELALWAYS |
WS_BORDER | WS_TABSTOP, 8, 122, 174, 78
@@ -16,7 +16,7 @@
PUSHBUTTON "&Colore...", IDC_COLOR_BUTTON, 188, 185, 50, 15
LTEXT "Posizione:", IDC_STATIC, 188, 146, 36, 9
COMBOBOX IDC_PLACEMENT_COMBO, 188, 157, 50, 54,
- CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
+ CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
END
IDD_SCREENSAVER DIALOGEX 0, 0, 246, 204
@@ -201,8 +201,8 @@
IDS_CPLDESCRIPTION "Adatta la visualizzazione del desktop e dello screen
saver."
IDS_NONE "(Niente)"
IDS_CENTER "Al centro"
- IDS_STRETCH "Affiancata"
- IDS_TILE "Estesa"
+ IDS_STRETCH "Estesa"
+ IDS_TILE "Affiancata"
END
STRINGTABLE DISCARDABLE
Modified: trunk/reactos/dll/cpl/desk/lang/ja-JP.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/lang/ja-JP.rc…
==============================================================================
--- trunk/reactos/dll/cpl/desk/lang/ja-JP.rc [iso-8859-1] (original)
+++ trunk/reactos/dll/cpl/desk/lang/ja-JP.rc [iso-8859-1] Wed Oct 6 14:13:00 2010
@@ -6,7 +6,7 @@
FONT 9, "MS UI Gothic"
BEGIN
CONTROL "", IDC_BACKGROUND_PREVIEW, "Static",
SS_OWNERDRAW,
- 70, 10, 105, 70,WS_EX_STATICEDGE
+ 70, 10, 105, 80, 0
CONTROL "",IDC_BACKGROUND_LIST,"SysListView32",LVS_REPORT
|
LVS_SINGLESEL | LVS_NOCOLUMNHEADER | LVS_SHAREIMAGELISTS |
LVS_SHOWSELALWAYS |
WS_BORDER | WS_TABSTOP, 8, 114, 174, 78
@@ -16,7 +16,7 @@
PUSHBUTTON "F(&C)...", IDC_COLOR_BUTTON, 188, 177, 50, 15
LTEXT "\\¦Êu:", IDC_STATIC, 188, 138, 36, 9
COMBOBOX IDC_PLACEMENT_COMBO, 188, 149, 50, 54,
- CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
+ CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
END
IDD_SCREENSAVER DIALOGEX 0, 0, 246, 204
Modified: trunk/reactos/dll/cpl/desk/lang/nl-NL.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/lang/nl-NL.rc…
==============================================================================
--- trunk/reactos/dll/cpl/desk/lang/nl-NL.rc [iso-8859-1] (original)
+++ trunk/reactos/dll/cpl/desk/lang/nl-NL.rc [iso-8859-1] Wed Oct 6 14:13:00 2010
@@ -8,7 +8,7 @@
FONT 8, "MS Shell Dlg"
BEGIN
CONTROL "", IDC_BACKGROUND_PREVIEW,
"Static",SS_OWNERDRAW,
- 70, 10, 105, 70, WS_EX_STATICEDGE
+ 70, 10, 105, 80, 0
CONTROL "", IDC_BACKGROUND_LIST, "SysListView32",
LVS_REPORT |
LVS_SINGLESEL | LVS_NOCOLUMNHEADER | LVS_SHAREIMAGELISTS |
LVS_SHOWSELALWAYS |
WS_BORDER | WS_TABSTOP, 7, 99, 173, 71
@@ -18,7 +18,7 @@
PUSHBUTTON "&Kleur...", IDC_COLOR_BUTTON, 187, 155, 50, 14
LTEXT "&Weergave:", IDC_STATIC, 187, 98, 36, 8
COMBOBOX IDC_PLACEMENT_COMBO, 187, 108, 50, 90,
- CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
+ CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
END
IDD_SCREENSAVER DIALOGEX 0, 0, 246, 204
Modified: trunk/reactos/dll/cpl/desk/lang/no-NO.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/lang/no-NO.rc…
==============================================================================
--- trunk/reactos/dll/cpl/desk/lang/no-NO.rc [iso-8859-1] (original)
+++ trunk/reactos/dll/cpl/desk/lang/no-NO.rc [iso-8859-1] Wed Oct 6 14:13:00 2010
@@ -6,7 +6,7 @@
FONT 8, "MS Shell Dlg"
BEGIN
CONTROL "", IDC_BACKGROUND_PREVIEW, "Static",
SS_OWNERDRAW,
- 70, 10, 105, 70,WS_EX_STATICEDGE
+ 70, 10, 105, 80, 0
CONTROL "",IDC_BACKGROUND_LIST,"SysListView32",LVS_REPORT
|
LVS_SINGLESEL | LVS_NOCOLUMNHEADER | LVS_SHAREIMAGELISTS |
LVS_SHOWSELALWAYS |
WS_BORDER | WS_TABSTOP, 8, 114, 174, 78
@@ -16,7 +16,7 @@
PUSHBUTTON "&Farger...", IDC_COLOR_BUTTON, 188, 177, 50, 15
LTEXT "Plassering:", IDC_STATIC, 188, 138, 36, 9
COMBOBOX IDC_PLACEMENT_COMBO, 188, 149, 50, 54,
- CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
+ CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
END
Modified: trunk/reactos/dll/cpl/desk/lang/pl-PL.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/lang/pl-PL.rc…
==============================================================================
--- trunk/reactos/dll/cpl/desk/lang/pl-PL.rc [iso-8859-1] (original)
+++ trunk/reactos/dll/cpl/desk/lang/pl-PL.rc [iso-8859-1] Wed Oct 6 14:13:00 2010
@@ -16,7 +16,7 @@
FONT 8, "MS Shell Dlg"
BEGIN
CONTROL "", IDC_BACKGROUND_PREVIEW, "Static",
SS_OWNERDRAW,
- 70, 10, 105, 70, WS_EX_STATICEDGE
+ 70, 10, 105, 80, 0
CONTROL "", IDC_BACKGROUND_LIST, "SysListView32",
LVS_REPORT |
LVS_SINGLESEL | LVS_NOCOLUMNHEADER | LVS_SHAREIMAGELISTS |
LVS_SHOWSELALWAYS |
WS_BORDER | WS_TABSTOP, 7, 99, 173, 71
@@ -26,7 +26,7 @@
PUSHBUTTON "&Kolor...", IDC_COLOR_BUTTON, 187, 155, 50, 14
LTEXT "Po³o¿enie:", IDC_STATIC, 187, 98, 36, 8
COMBOBOX IDC_PLACEMENT_COMBO, 187, 108, 50, 90,
- CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
+ CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
END
IDD_SCREENSAVER DIALOGEX 0, 0, 246, 204
Modified: trunk/reactos/dll/cpl/desk/lang/ro-RO.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/lang/ro-RO.rc…
==============================================================================
--- trunk/reactos/dll/cpl/desk/lang/ro-RO.rc [iso-8859-1] (original)
+++ trunk/reactos/dll/cpl/desk/lang/ro-RO.rc [iso-8859-1] Wed Oct 6 14:13:00 2010
@@ -8,7 +8,7 @@
FONT 8, "MS Shell Dlg"
BEGIN
CONTROL "", IDC_BACKGROUND_PREVIEW, "Static",
SS_OWNERDRAW,
- 70, 10, 105, 70,WS_EX_STATICEDGE
+ 70, 10, 105, 80, 0
CONTROL "",IDC_BACKGROUND_LIST,"SysListView32",LVS_REPORT
|
LVS_SINGLESEL | LVS_NOCOLUMNHEADER | LVS_SHAREIMAGELISTS |
LVS_SHOWSELALWAYS |
WS_BORDER | WS_TABSTOP, 8, 114, 174, 78
@@ -18,7 +18,7 @@
PUSHBUTTON "&Culoare...", IDC_COLOR_BUTTON, 188, 177, 50, 15
LTEXT "PoziÈie:", IDC_STATIC, 188, 138, 36, 9
COMBOBOX IDC_PLACEMENT_COMBO, 188, 149, 50, 54,
- CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
+ CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
END
Modified: trunk/reactos/dll/cpl/desk/lang/ru-RU.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/lang/ru-RU.rc…
==============================================================================
--- trunk/reactos/dll/cpl/desk/lang/ru-RU.rc [iso-8859-1] (original)
+++ trunk/reactos/dll/cpl/desk/lang/ru-RU.rc [iso-8859-1] Wed Oct 6 14:13:00 2010
@@ -6,7 +6,7 @@
FONT 8, "MS Shell Dlg"
BEGIN
CONTROL "", IDC_BACKGROUND_PREVIEW, "Static",
SS_OWNERDRAW,
- 70, 10, 105, 70, WS_EX_STATICEDGE
+ 70, 10, 105, 80, 0
CONTROL "", IDC_BACKGROUND_LIST, "SysListView32",
LVS_REPORT |
LVS_SINGLESEL | LVS_NOCOLUMNHEADER | LVS_SHAREIMAGELISTS |
LVS_SHOWSELALWAYS |
WS_BORDER | WS_TABSTOP, 8, 114, 174, 78
@@ -16,7 +16,7 @@
PUSHBUTTON "&Öâåò...", IDC_COLOR_BUTTON, 188, 167, 55, 15
LTEXT "Ðàñïîëîæåíèå:", IDC_STATIC, 188, 138, 55, 9
COMBOBOX IDC_PLACEMENT_COMBO, 188, 149, 55, 54,
- CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
+ CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
END
IDD_SCREENSAVER DIALOGEX 0, 0, 246, 204
Modified: trunk/reactos/dll/cpl/desk/lang/sk-SK.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/lang/sk-SK.rc…
==============================================================================
--- trunk/reactos/dll/cpl/desk/lang/sk-SK.rc [iso-8859-1] (original)
+++ trunk/reactos/dll/cpl/desk/lang/sk-SK.rc [iso-8859-1] Wed Oct 6 14:13:00 2010
@@ -14,7 +14,7 @@
FONT 8, "MS Shell Dlg"
BEGIN
CONTROL "", IDC_BACKGROUND_PREVIEW, "Static",
SS_OWNERDRAW,
- 70, 10, 105, 70,WS_EX_STATICEDGE
+ 70, 10, 105, 80, 0
CONTROL "",IDC_BACKGROUND_LIST,"SysListView32",LVS_REPORT
|
LVS_SINGLESEL | LVS_NOCOLUMNHEADER | LVS_SHAREIMAGELISTS |
LVS_SHOWSELALWAYS |
WS_BORDER | WS_TABSTOP, 8, 114, 174, 78
@@ -24,7 +24,7 @@
PUSHBUTTON "&Farba...", IDC_COLOR_BUTTON, 188, 177, 50, 15
LTEXT "&Umiestnenie:", IDC_STATIC, 188, 138, 50, 9
COMBOBOX IDC_PLACEMENT_COMBO, 188, 149, 50, 54,
- CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
+ CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
END
Modified: trunk/reactos/dll/cpl/desk/lang/sv-SE.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/lang/sv-SE.rc…
==============================================================================
--- trunk/reactos/dll/cpl/desk/lang/sv-SE.rc [iso-8859-1] (original)
+++ trunk/reactos/dll/cpl/desk/lang/sv-SE.rc [iso-8859-1] Wed Oct 6 14:13:00 2010
@@ -9,7 +9,7 @@
FONT 8, "MS Shell Dlg"
BEGIN
CONTROL "",IDC_BACKGROUND_PREVIEW,"Static",SS_OWNERDRAW,
- 70, 10, 105, 70,WS_EX_STATICEDGE
+ 70, 10, 105, 80, 0
CONTROL "",IDC_BACKGROUND_LIST,"SysListView32",LVS_REPORT
|
LVS_SINGLESEL | LVS_NOCOLUMNHEADER | LVS_SHAREIMAGELISTS |
LVS_SHOWSELALWAYS |
WS_BORDER | WS_TABSTOP,7,99,173,71
@@ -19,7 +19,7 @@
PUSHBUTTON "&Färg...",IDC_COLOR_BUTTON,187,155,50,14
LTEXT "Placering:",IDC_STATIC,187,98,36,8
COMBOBOX IDC_PLACEMENT_COMBO,187,108,50,90,CBS_DROPDOWNLIST |
- CBS_SORT | WS_VSCROLL | WS_TABSTOP
+ WS_VSCROLL | WS_TABSTOP
END
IDD_SCREENSAVER DIALOGEX 0, 0, 246, 204
Modified: trunk/reactos/dll/cpl/desk/lang/uk-UA.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/lang/uk-UA.rc…
==============================================================================
--- trunk/reactos/dll/cpl/desk/lang/uk-UA.rc [iso-8859-1] (original)
+++ trunk/reactos/dll/cpl/desk/lang/uk-UA.rc [iso-8859-1] Wed Oct 6 14:13:00 2010
@@ -14,7 +14,7 @@
FONT 8, "MS Shell Dlg"
BEGIN
CONTROL "", IDC_BACKGROUND_PREVIEW, "Static",
SS_OWNERDRAW,
- 70, 10, 105, 70, WS_EX_STATICEDGE
+ 70, 10, 105, 80, 0
CONTROL "", IDC_BACKGROUND_LIST, "SysListView32",
LVS_REPORT |
LVS_SINGLESEL | LVS_NOCOLUMNHEADER | LVS_SHAREIMAGELISTS |
LVS_SHOWSELALWAYS |
WS_BORDER | WS_TABSTOP, 8, 114, 174, 78
@@ -24,7 +24,7 @@
PUSHBUTTON "&Êîë³ð...", IDC_COLOR_BUTTON, 188, 177, 50, 15
LTEXT "Ðîçòàøóâàííÿ:", IDC_STATIC, 188, 138, 51, 9
COMBOBOX IDC_PLACEMENT_COMBO, 188, 149, 50, 54,
- CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
+ CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
END
IDD_SCREENSAVER DIALOGEX 0, 0, 246, 204
Modified: trunk/reactos/dll/cpl/desk/lang/zh-CN.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/lang/zh-CN.rc…
==============================================================================
--- trunk/reactos/dll/cpl/desk/lang/zh-CN.rc [iso-8859-1] (original)
+++ trunk/reactos/dll/cpl/desk/lang/zh-CN.rc [iso-8859-1] Wed Oct 6 14:13:00 2010
@@ -13,7 +13,7 @@
FONT 9, "MS Shell Dlg"
BEGIN
CONTROL "", IDC_BACKGROUND_PREVIEW, "Static",
SS_OWNERDRAW,
- 70, 10, 105, 70,WS_EX_STATICEDGE
+ 70, 10, 105, 80, 0
CONTROL "",IDC_BACKGROUND_LIST,"SysListView32",LVS_REPORT
|
LVS_SINGLESEL | LVS_NOCOLUMNHEADER | LVS_SHAREIMAGELISTS |
LVS_SHOWSELALWAYS |
WS_BORDER | WS_TABSTOP, 8, 114, 174, 78
@@ -23,7 +23,7 @@
PUSHBUTTON "ÑÕÉ«(&C)...", IDC_COLOR_BUTTON, 188, 177, 50, 15
LTEXT "λÖÃ:", IDC_STATIC, 188, 138, 36, 9
COMBOBOX IDC_PLACEMENT_COMBO, 188, 149, 50, 54,
- CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
+ CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
END
Modified: trunk/reactos/dll/cpl/desk/screensaver.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/screensaver.c…
==============================================================================
--- trunk/reactos/dll/cpl/desk/screensaver.c [iso-8859-1] (original)
+++ trunk/reactos/dll/cpl/desk/screensaver.c [iso-8859-1] Wed Oct 6 14:13:00 2010
@@ -22,9 +22,10 @@
typedef struct _DATA
{
- ScreenSaverItem ScreenSaverItems[MAX_SCREENSAVERS];
+ ScreenSaverItem ScreenSaverItems[MAX_SCREENSAVERS];
PROCESS_INFORMATION PrevWindowPi;
- int Selection;
+ int Selection;
+ UINT ScreenSaverCount;
} DATA, *PDATA;
@@ -235,7 +236,7 @@
/s Run normal
*/
- WCHAR szCmdline[2048];
+ TCHAR szCmdline[2048];
STARTUPINFO si;
PROCESS_INFORMATION pi;
@@ -322,59 +323,39 @@
static VOID
-AddScreenSavers(HWND hwndDlg, PDATA pData)
-{
- HWND hwndScreenSavers = GetDlgItem(hwndDlg, IDC_SCREENS_LIST);
- WIN32_FIND_DATA fd;
- HANDLE hFind;
- TCHAR szSearchPath[MAX_PATH];
- INT i;
- int ScreenSaverCount = 0;
- ScreenSaverItem *ScreenSaverItem = NULL;
- HANDLE hModule = NULL;
-
- /* Add the "None" item */
- ScreenSaverItem = &pData->ScreenSaverItems[ScreenSaverCount];
-
- ScreenSaverItem->bIsScreenSaver = FALSE;
-
- LoadString(hApplet,
- IDS_NONE,
- ScreenSaverItem->szDisplayName,
- sizeof(ScreenSaverItem->szDisplayName) / sizeof(TCHAR));
-
- i = SendMessage(hwndScreenSavers,
- CB_ADDSTRING,
- 0,
- (LPARAM)ScreenSaverItem->szDisplayName);
-
- SendMessage(hwndScreenSavers,
- CB_SETITEMDATA,
- i,
- (LPARAM)ScreenSaverCount);
-
- ScreenSaverCount++;
-
- /* Add all the screensavers in the C:\ReactOS\System32 directory. */
-
- GetSystemDirectory(szSearchPath, MAX_PATH);
+SearchScreenSavers(HWND hwndScreenSavers,
+ LPCTSTR pszSearchPath,
+ PDATA pData)
+{
+ WIN32_FIND_DATA fd;
+ TCHAR szSearchPath[MAX_PATH];
+ HANDLE hFind;
+ ScreenSaverItem *ScreenSaverItem;
+ HANDLE hModule;
+ UINT i, ScreenSaverCount;
+
+ ScreenSaverCount = pData->ScreenSaverCount;
+
+ _tcscpy(szSearchPath, pszSearchPath);
_tcscat(szSearchPath, TEXT("\\*.scr"));
hFind = FindFirstFile(szSearchPath, &fd);
- while (ScreenSaverCount < MAX_SCREENSAVERS-1 &&
- hFind != INVALID_HANDLE_VALUE)
+
+ if (hFind == INVALID_HANDLE_VALUE)
+ return;
+
+ while (ScreenSaverCount < MAX_SCREENSAVERS)
{
/* Don't add any hidden screensavers */
if ((fd.dwFileAttributes & FILE_ATTRIBUTE_HIDDEN) == 0)
{
TCHAR filename[MAX_PATH];
- GetSystemDirectory(filename, MAX_PATH);
-
- _tcscat(filename, TEXT("\\"));
+ _tcscpy(filename, pszSearchPath);
+ _tcscat(filename, _T("\\"));
_tcscat(filename, fd.cFileName);
- ScreenSaverItem = &pData->ScreenSaverItems[ScreenSaverCount];
+ ScreenSaverItem = pData->ScreenSaverItems + ScreenSaverCount;
ScreenSaverItem->bIsScreenSaver = TRUE;
@@ -383,11 +364,16 @@
DONT_RESOLVE_DLL_REFERENCES |
LOAD_LIBRARY_AS_DATAFILE);
if (hModule)
{
- LoadString(hModule,
+ if (0 == LoadString(hModule,
1,
ScreenSaverItem->szDisplayName,
- sizeof(ScreenSaverItem->szDisplayName) / sizeof(TCHAR));
- FreeLibrary(hModule);
+ sizeof(ScreenSaverItem->szDisplayName) / sizeof(TCHAR)))
+ {
+ // If the string does not exists, copy the name of the file
+ _tcscpy(ScreenSaverItem->szDisplayName, fd.cFileName);
+ ScreenSaverItem->szDisplayName[_tcslen(fd.cFileName)-4] =
'\0';
+ }
+ FreeLibrary(hModule);
}
else
{
@@ -410,7 +396,62 @@
}
if (!FindNextFile(hFind, &fd))
- hFind = INVALID_HANDLE_VALUE;
+ break;
+ }
+
+ FindClose(hFind);
+
+ pData->ScreenSaverCount = ScreenSaverCount;
+}
+
+
+static VOID
+AddScreenSavers(HWND hwndDlg, PDATA pData)
+{
+ HWND hwndScreenSavers = GetDlgItem(hwndDlg, IDC_SCREENS_LIST);
+ TCHAR szSearchPath[MAX_PATH];
+ INT i;
+ ScreenSaverItem *ScreenSaverItem = NULL;
+ LPTSTR lpBackSlash;
+
+ /* Add the "None" item */
+ ScreenSaverItem = pData->ScreenSaverItems;
+
+ ScreenSaverItem->bIsScreenSaver = FALSE;
+
+ LoadString(hApplet,
+ IDS_NONE,
+ ScreenSaverItem->szDisplayName,
+ sizeof(ScreenSaverItem->szDisplayName) / sizeof(TCHAR));
+
+ i = SendMessage(hwndScreenSavers,
+ CB_ADDSTRING,
+ 0,
+ (LPARAM)ScreenSaverItem->szDisplayName);
+
+ SendMessage(hwndScreenSavers,
+ CB_SETITEMDATA,
+ i,
+ (LPARAM)0);
+
+ // Initialize number of items into the list
+ pData->ScreenSaverCount = 1;
+
+ // Add all the screensavers in the C:\ReactOS\System32 directory.
+ GetSystemDirectory(szSearchPath, MAX_PATH);
+ SearchScreenSavers(hwndScreenSavers, szSearchPath, pData);
+
+ // Add all the screensavers in the C:\ReactOS directory.
+ GetWindowsDirectory(szSearchPath, MAX_PATH);
+ SearchScreenSavers(hwndScreenSavers, szSearchPath, pData);
+
+ // Add all the screensavers where the applet is stored.
+ GetModuleFileName(hApplet, szSearchPath, MAX_PATH);
+ lpBackSlash = _tcsrchr(szSearchPath, _T('\\'));
+ if (lpBackSlash != NULL)
+ {
+ lpBackSlash = '\0';
+ SearchScreenSavers(hwndScreenSavers, szSearchPath, pData);
}
}