mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 18:15:11 +00:00
removed hard-coded comdlg filter from desk.cpl and it now searches for bmp;jpeg;png in windir patch by Christoph_vW see Bug 885
svn path=/trunk/; revision=18433
This commit is contained in:
parent
578f7922e1
commit
8173b668de
4 changed files with 87 additions and 55 deletions
|
@ -52,12 +52,13 @@ HWND g_hColorButton = NULL;
|
|||
|
||||
HIMAGELIST g_hShellImageList = NULL;
|
||||
|
||||
/* Add the bitmaps in the C:\ReactOS directory and the current wallpaper if any */
|
||||
/* Add the images in the C:\ReactOS directory and the current wallpaper if any */
|
||||
void AddListViewItems()
|
||||
{
|
||||
WIN32_FIND_DATA fd;
|
||||
HANDLE hFind;
|
||||
TCHAR szSearchPath[MAX_PATH];
|
||||
TCHAR szFileTypes[MAX_PATH];
|
||||
LV_ITEM listItem;
|
||||
LV_COLUMN dummy;
|
||||
RECT clientRect;
|
||||
|
@ -151,10 +152,19 @@ void AddListViewItems()
|
|||
|
||||
RegCloseKey(regKey);
|
||||
|
||||
/* Add all the bitmaps in the C:\ReactOS directory. */
|
||||
/* Add all the images in the C:\ReactOS directory. */
|
||||
|
||||
LoadString(hApplet, IDS_SUPPORTED_EXT, szFileTypes, sizeof(szFileTypes) / sizeof(TCHAR));
|
||||
|
||||
TCHAR separators[] = TEXT(";");
|
||||
TCHAR *token;
|
||||
|
||||
token = _tcstok ( szFileTypes, separators );
|
||||
while ( token != NULL )
|
||||
{
|
||||
GetWindowsDirectory(szSearchPath, MAX_PATH);
|
||||
_tcscat(szSearchPath, TEXT("\\*.bmp"));
|
||||
_tcscat(szSearchPath, TEXT("\\"));
|
||||
_tcscat(szSearchPath, token);
|
||||
|
||||
hFind = FindFirstFile(szSearchPath, &fd);
|
||||
while(hFind != INVALID_HANDLE_VALUE)
|
||||
|
@ -210,6 +220,11 @@ void AddListViewItems()
|
|||
if(!FindNextFile(hFind, &fd))
|
||||
hFind = INVALID_HANDLE_VALUE;
|
||||
}
|
||||
|
||||
token = _tcstok ( NULL, separators );
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
void InitBackgroundDialog()
|
||||
|
@ -293,6 +308,7 @@ void OnBrowseButton()
|
|||
OPENFILENAME ofn;
|
||||
TCHAR filename[MAX_PATH];
|
||||
TCHAR fileTitle[256];
|
||||
TCHAR filter[MAX_PATH];
|
||||
BackgroundItem *backgroundItem = NULL;
|
||||
|
||||
ZeroMemory(&ofn, sizeof(OPENFILENAME));
|
||||
|
@ -301,11 +317,13 @@ void OnBrowseButton()
|
|||
ofn.hwndOwner = g_hBackgroundPage;
|
||||
ofn.lpstrFile = filename;
|
||||
|
||||
LoadString(hApplet, IDS_BACKGROUND_COMDLG_FILTER, filter, sizeof(filter) / sizeof(TCHAR));
|
||||
|
||||
/* Set lpstrFile[0] to '\0' so that GetOpenFileName does not
|
||||
* use the contents of szFile to initialize itself */
|
||||
ofn.lpstrFile[0] = TEXT('\0');
|
||||
ofn.nMaxFile = MAX_PATH;
|
||||
ofn.lpstrFilter = TEXT("Bitmap Files (*.bmp)\0*.bmp\0");
|
||||
ofn.lpstrFilter = filter;
|
||||
ofn.nFilterIndex = 0;
|
||||
ofn.lpstrFileTitle = fileTitle;
|
||||
ofn.nMaxFileTitle = 256;
|
||||
|
|
|
@ -78,3 +78,9 @@ BEGIN
|
|||
IDS_COLOR_32BIT "True Color (32 Bit)"
|
||||
IDS_PIXEL "%lux%lu Pixel"
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
IDS_BACKGROUND_COMDLG_FILTER "Bilddateien (*.bmp;*.jpg;*.dib;*.png)\0*.bmp;*.jpg;*.jpeg;*.dib;*.png\0"
|
||||
IDS_SUPPORTED_EXT "*.jpg;*.jpeg;*.bmp;*.dib;*.png"
|
||||
END
|
||||
|
|
|
@ -102,3 +102,9 @@ BEGIN
|
|||
IDS_COLOR_32BIT "True Color (32 Bit)"
|
||||
IDS_PIXEL "%lux%lu Pixel"
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
IDS_BACKGROUND_COMDLG_FILTER "Pictures (*.bmp;*.jpg;*.dib;*.png)\0*.bmp;*.jpg;*.jpeg;*.dib;*.png\0"
|
||||
IDS_SUPPORTED_EXT "*.jpg;*.jpeg;*.bmp;*.dib;*.png"
|
||||
END
|
||||
|
|
|
@ -27,6 +27,8 @@
|
|||
#define IDC_BROWSE_BUTTON 1002
|
||||
#define IDC_COLOR_BUTTON 1003
|
||||
#define IDC_PLACEMENT_COMBO 1004
|
||||
#define IDS_BACKGROUND_COMDLG_FILTER 1005
|
||||
#define IDS_SUPPORTED_EXT 1006
|
||||
|
||||
/* Screensaver Page */
|
||||
#define IDC_SCREENS_CHOICES 1010
|
||||
|
|
Loading…
Reference in a new issue