Trevor McCort implemented desktop wallpaper changing

svn path=/trunk/; revision=13406
This commit is contained in:
Thomas Bluemel 2005-02-04 20:39:10 +00:00
parent 01e24007ea
commit efd11df7cc
15 changed files with 1014 additions and 477 deletions

View file

@ -771,6 +771,7 @@ extern "C" {
#define DS_SETFONT (0x40L)
#define DS_SETFOREGROUND (0x200L)
#define DS_SYSMODAL (0x2L)
#define DS_SHELLFONT (DS_SETFONT | DS_FIXEDSYS)
/* CreateWindowEx */
#define WS_EX_ACCEPTFILES (0x10L)

View file

@ -13,20 +13,20 @@ TARGET_INSTALLDIR = system32
TARGET_BASE = $(TARGET_BASE_LIB_CPL_DESK)
TARGET_CFLAGS = \
-I./include \
-I./include \
-D_WIN32_IE=0x0600 \
-D_WIN32_WINNT=0x0501 \
-D__USE_W32API \
-DUNICODE \
-D_UNICODE \
-D__REACTOS__ \
-D__USE_W32API \
-Wall \
-Werror \
-fno-builtin
TARGET_LFLAGS = -nostartfiles
TARGET_SDKLIBS = kernel32.a user32.a comctl32.a
TARGET_SDKLIBS = kernel32.a user32.a comctl32.a comdlg32.a advapi32.a gdi32.a
TARGET_GCCLIBS = gcc
@ -34,7 +34,12 @@ TARGET_PCH =
TARGET_CLEAN =
TARGET_OBJECTS = desk.o
TARGET_OBJECTS = desk.o \
background.o \
screensaver.o \
appearance.o \
settings.o \
dibitmap.o
DEP_OBJECTS = $(TARGET_OBJECTS)

View file

@ -0,0 +1,34 @@
/* $Id$
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS Display Control Panel
* FILE: lib/cpl/desk/appearance.c
* PURPOSE: Appearance property page
*
* PROGRAMMERS: Trevor McCort (lycan359@gmail.com)
*/
#include <windows.h>
#include <commctrl.h>
#include "resource.h"
INT_PTR CALLBACK AppearancePageProc(HWND hwndDlg,
UINT uMsg,
WPARAM wParam,
LPARAM lParam)
{
switch(uMsg)
{
case WM_INITDIALOG:
{
} break;
case WM_COMMAND:
{
} break;
}
return FALSE;
}

View file

@ -0,0 +1,597 @@
/* $Id$
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS Display Control Panel
* FILE: lib/cpl/desk/background.c
* PURPOSE: Background property page
*
* PROGRAMMERS: Trevor McCort (lycan359@gmail.com)
*/
#include <windows.h>
#include <commctrl.h>
#include <commdlg.h>
#include <cpl.h>
#include <tchar.h>
#include "resource.h"
#include "desk.h"
#include "dibitmap.h"
#define MAX_WALLPAPERS 100
#define PLACEMENT_CENTER 0
#define PLACEMENT_STRETCH 1
#define PLACEMENT_TILE 2
DIBitmap *g_pWallpaperBitmap = NULL;
int g_placementSelection = 0;
int g_wallpaperSelection = -1;
int g_wallpaperCount = 0;
int g_listViewItemCount = 0;
int g_currentWallpaperItemId = 0;
HWND g_hBackgroundTab = NULL;
HWND g_hWallpaperList = NULL;
HWND g_hWallpaperPreview = NULL;
HIMAGELIST g_hShellImageList = NULL;
HWND g_hPlacementCombo = NULL;
TCHAR g_wallpapers[MAX_WALLPAPERS][MAX_PATH];
/* Add the bitmaps in the C:\ReactOS directory and the current wallpaper if any */
void AddListViewItems()
{
WIN32_FIND_DATA fd;
HANDLE hFind;
TCHAR szBuffer[256];
TCHAR szSearchPath[MAX_PATH];
LV_ITEM listItem;
LV_COLUMN dummy;
RECT clientRect;
HKEY regKey;
SHFILEINFO sfi;
HIMAGELIST himl;
TCHAR wallpaperFilename[MAX_PATH];
DWORD bufferSize = sizeof(wallpaperFilename);
DWORD varType = REG_SZ;
LONG result;
UINT i = 0;
GetClientRect(g_hWallpaperList, &clientRect);
ZeroMemory(&dummy, sizeof(LV_COLUMN));
dummy.mask = LVCF_SUBITEM | LVCF_WIDTH;
dummy.iSubItem = 0;
dummy.cx = (clientRect.right - clientRect.left) - GetSystemMetrics(SM_CXVSCROLL);
ListView_InsertColumn(g_hWallpaperList, 0, &dummy);
/* Add the "None" item */
LoadString(hApplet, IDS_NONE, szBuffer, sizeof(szBuffer) / sizeof(TCHAR));
ZeroMemory(&listItem, sizeof(LV_ITEM));
listItem.mask = LVIF_TEXT | LVIF_PARAM | LVIF_STATE | LVIF_IMAGE;
listItem.pszText = szBuffer;
listItem.iItem = g_listViewItemCount;
listItem.iImage = -1;
listItem.state = LVIS_SELECTED;
listItem.lParam = -1;
ListView_InsertItem(g_hWallpaperList, &listItem);
ListView_SetItemState(g_hWallpaperList, g_listViewItemCount, LVIS_SELECTED, LVIS_SELECTED);
g_listViewItemCount++;
/* Add current wallpaper if any */
RegOpenKeyEx(HKEY_CURRENT_USER, TEXT("Control Panel\\Desktop"), 0, KEY_ALL_ACCESS, &regKey);
result = RegQueryValueEx(regKey, TEXT("Wallpaper"), 0, &varType, (LPBYTE)wallpaperFilename, &bufferSize);
if((result == ERROR_SUCCESS) && (_tcslen(wallpaperFilename) > 0))
{
himl = (HIMAGELIST)SHGetFileInfo(wallpaperFilename,
0,
&sfi,
sizeof(sfi),
SHGFI_SYSICONINDEX | SHGFI_SMALLICON |
SHGFI_DISPLAYNAME);
if(himl != NULL)
{
if(i++ == 0)
{
g_hShellImageList = himl;
ListView_SetImageList(g_hWallpaperList, himl, LVSIL_SMALL);
}
ZeroMemory(&listItem, sizeof(LV_ITEM));
listItem.mask = LVIF_TEXT | LVIF_PARAM | LVIF_STATE | LVIF_IMAGE;
listItem.pszText = sfi.szDisplayName;
listItem.state = LVIS_SELECTED;
listItem.iItem = g_listViewItemCount;
listItem.iImage = sfi.iIcon;
listItem.lParam = g_wallpaperCount;
ListView_InsertItem(g_hWallpaperList, &listItem);
_tcscpy(g_wallpapers[g_wallpaperCount], wallpaperFilename);
ListView_SetItemState(g_hWallpaperList, g_listViewItemCount, LVIS_SELECTED, LVIS_SELECTED);
g_currentWallpaperItemId = g_listViewItemCount;
g_listViewItemCount++;
g_wallpaperCount++;
}
}
RegCloseKey(regKey);
/* Add all the bitmaps in the C:\ReactOS directory. */
GetWindowsDirectory(szSearchPath, MAX_PATH);
_tcscat(szSearchPath, TEXT("\\*.bmp"));
hFind = FindFirstFile(szSearchPath, &fd);
while(hFind != INVALID_HANDLE_VALUE)
{
/* Don't add any hidden bitmaps */
if((fd.dwFileAttributes & FILE_ATTRIBUTE_HIDDEN) == 0)
{
TCHAR filename[MAX_PATH];
GetWindowsDirectory(filename, MAX_PATH);
_tcscat(filename, TEXT("\\"));
_tcscat(filename, fd.cFileName);
himl = (HIMAGELIST)SHGetFileInfo(filename,
0,
&sfi,
sizeof(sfi),
SHGFI_SYSICONINDEX | SHGFI_SMALLICON |
SHGFI_DISPLAYNAME);
if(himl == NULL)
{
break;
}
if(i++ == 0)
{
g_hShellImageList = himl;
ListView_SetImageList(g_hWallpaperList, himl, LVSIL_SMALL);
}
ZeroMemory(&listItem, sizeof(LV_ITEM));
listItem.mask = LVIF_TEXT | LVIF_PARAM | LVIF_STATE | LVIF_IMAGE;
listItem.pszText = sfi.szDisplayName;
listItem.state = 0;
listItem.iItem = g_listViewItemCount++;
listItem.iImage = sfi.iIcon;
listItem.lParam = g_wallpaperCount;
ListView_InsertItem(g_hWallpaperList, &listItem);
_tcscpy(g_wallpapers[g_wallpaperCount], filename);
g_wallpaperCount++;
}
if(!FindNextFile(hFind, &fd))
hFind = INVALID_HANDLE_VALUE;
}
}
void InitBackgroundDialog()
{
g_hWallpaperList = GetDlgItem(g_hBackgroundTab, IDC_WALLPAPER_LIST);
g_hWallpaperPreview = GetDlgItem(g_hBackgroundTab, IDC_WALLPAPER_PREVIEW);
g_hPlacementCombo = GetDlgItem(g_hBackgroundTab, IDC_PLACEMENT_COMBO);
AddListViewItems();
TCHAR szString[256];
LoadString(hApplet, IDS_CENTER, szString, sizeof(szString) / sizeof(TCHAR));
SendMessage(g_hPlacementCombo, CB_INSERTSTRING, PLACEMENT_CENTER, (LPARAM)szString);
LoadString(hApplet, IDS_STRETCH, szString, sizeof(szString) / sizeof(TCHAR));
SendMessage(g_hPlacementCombo, CB_INSERTSTRING, PLACEMENT_STRETCH, (LPARAM)szString);
LoadString(hApplet, IDS_TILE, szString, sizeof(szString) / sizeof(TCHAR));
SendMessage(g_hPlacementCombo, CB_INSERTSTRING, PLACEMENT_TILE, (LPARAM)szString);
/* Load the default settings from the registry */
HKEY regKey;
TCHAR szBuffer[2];
DWORD bufferSize = sizeof(szBuffer);
DWORD varType = REG_SZ;
LONG result;
RegOpenKeyEx(HKEY_CURRENT_USER, TEXT("Control Panel\\Desktop"), 0, KEY_ALL_ACCESS, &regKey);
result = RegQueryValueEx(regKey, TEXT("WallpaperStyle"), 0, &varType, (LPBYTE)szBuffer, &bufferSize);
if(result == ERROR_SUCCESS)
{
if(_ttoi(szBuffer) == 0)
{
SendMessage(g_hPlacementCombo, CB_SETCURSEL, PLACEMENT_CENTER, 0);
g_placementSelection = PLACEMENT_CENTER;
}
if(_ttoi(szBuffer) == 2)
{
SendMessage(g_hPlacementCombo, CB_SETCURSEL, PLACEMENT_STRETCH, 0);
g_placementSelection = PLACEMENT_STRETCH;
}
}
else
{
SendMessage(g_hPlacementCombo, CB_SETCURSEL, PLACEMENT_CENTER, 0);
g_placementSelection = PLACEMENT_CENTER;
}
result = RegQueryValueEx(regKey, TEXT("TileWallpaper"), 0, &varType, (LPBYTE)szBuffer, &bufferSize);
if(result == ERROR_SUCCESS)
{
if(_ttoi(szBuffer) == 1)
{
SendMessage(g_hPlacementCombo, CB_SETCURSEL, PLACEMENT_TILE, 0);
g_placementSelection = PLACEMENT_TILE;
}
}
RegCloseKey(regKey);
}
void OnPatternButton()
{
MessageBox(NULL, TEXT("That button doesn't do anything yet"), TEXT("Whoops"), MB_OK);
}
BOOL CheckListBoxFilename(HWND list, TCHAR *filename)
{
return FALSE;
}
void OnBrowseButton()
{
OPENFILENAME ofn;
TCHAR filename[MAX_PATH];
TCHAR fileTitle[256];
ZeroMemory(&ofn, sizeof(OPENFILENAME));
ofn.lStructSize = sizeof(OPENFILENAME);
ofn.hwndOwner = g_hBackgroundTab;
ofn.lpstrFile = filename;
/* 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.nFilterIndex = 0;
ofn.lpstrFileTitle = fileTitle;
ofn.nMaxFileTitle = 256;
ofn.lpstrInitialDir = NULL;
ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST;
if(GetOpenFileName(&ofn) == TRUE)
{
/* Check if there is already a entry that holds this filename */
if(CheckListBoxFilename(g_hWallpaperList, filename) == FALSE)
{
SHFILEINFO sfi;
LV_ITEM listItem;
if(g_wallpaperCount > (MAX_WALLPAPERS - 1))
return;
_tcscpy(g_wallpapers[g_wallpaperCount], filename);
SHGetFileInfo(filename,
0,
&sfi,
sizeof(sfi),
SHGFI_SYSICONINDEX | SHGFI_SMALLICON | SHGFI_DISPLAYNAME);
ZeroMemory(&listItem, sizeof(LV_ITEM));
listItem.mask = LVIF_TEXT | LVIF_PARAM | LVIF_STATE | LVIF_IMAGE;
listItem.pszText = sfi.szDisplayName;
listItem.state = 0;
listItem.iItem = g_listViewItemCount++;
listItem.iImage = sfi.iIcon;
listItem.lParam = g_wallpaperCount;
ListView_InsertItem(g_hWallpaperList, &listItem);
g_wallpaperCount++;
}
}
}
void ListViewItemChanged(int itemIndex)
{
if(g_pWallpaperBitmap != NULL)
{
DibFreeImage(g_pWallpaperBitmap);
g_pWallpaperBitmap = NULL;
}
LV_ITEM listItem;
listItem.iItem = itemIndex;
listItem.mask = LVIF_PARAM;
ListView_GetItem(g_hWallpaperList, &listItem);
if(listItem.lParam == -1)
{
g_wallpaperSelection = -1;
InvalidateRect(g_hWallpaperPreview, NULL, TRUE);
}
else
{
g_wallpaperSelection = listItem.lParam;
g_pWallpaperBitmap = DibLoadImage(g_wallpapers[g_wallpaperSelection]);
if(g_pWallpaperBitmap == NULL)
{
}
InvalidateRect(g_hWallpaperPreview, NULL, TRUE);
}
EnableWindow(g_hPlacementCombo, (listItem.lParam != -1 ? TRUE : FALSE));
PropSheet_Changed(GetParent(g_hBackgroundTab), g_hBackgroundTab);
}
void DrawWallpaperPreview(LPDRAWITEMSTRUCT draw)
{
if(g_wallpaperSelection == -1)
{
FillRect(draw->hDC, &draw->rcItem, GetSysColorBrush(COLOR_BACKGROUND));
return;
}
if(g_pWallpaperBitmap == NULL)
return;
float scaleX = ((float)GetSystemMetrics(SM_CXSCREEN) - 1) / (float)draw->rcItem.right;
float scaleY = ((float)GetSystemMetrics(SM_CYSCREEN) - 1) / (float)draw->rcItem.bottom;
int scaledWidth = g_pWallpaperBitmap->width / scaleX;
int scaledHeight = g_pWallpaperBitmap->height / scaleY;
int posX = (draw->rcItem.right / 2) - (scaledWidth / 2);
int posY = (draw->rcItem.bottom / 2) - (scaledHeight / 2);
FillRect(draw->hDC, &draw->rcItem, GetSysColorBrush(COLOR_BACKGROUND));
SetStretchBltMode(draw->hDC, COLORONCOLOR);
if(g_placementSelection == PLACEMENT_CENTER)
{
StretchDIBits(draw->hDC,
posX,
posY,
scaledWidth,
scaledHeight,
0,
0,
g_pWallpaperBitmap->width,
g_pWallpaperBitmap->height,
g_pWallpaperBitmap->bits,
g_pWallpaperBitmap->info,
DIB_RGB_COLORS,
SRCCOPY);
}
if(g_placementSelection == PLACEMENT_STRETCH)
{
StretchDIBits(draw->hDC,
0,
0,
draw->rcItem.right,
draw->rcItem.bottom,
0,
0,
g_pWallpaperBitmap->width,
g_pWallpaperBitmap->height,
g_pWallpaperBitmap->bits,
g_pWallpaperBitmap->info,
DIB_RGB_COLORS,
SRCCOPY);
}
if(g_placementSelection == PLACEMENT_TILE)
{
int x;
int y;
for(y = 0; y < draw->rcItem.bottom; y += scaledHeight)
{
for(x = 0; x < draw->rcItem.right; x += scaledWidth)
{
StretchDIBits(draw->hDC,
x,
y,
scaledWidth,
scaledHeight,
0,
0,
g_pWallpaperBitmap->width,
g_pWallpaperBitmap->height,
g_pWallpaperBitmap->bits,
g_pWallpaperBitmap->info,
DIB_RGB_COLORS,
SRCCOPY);
}
}
}
}
void SetWallpaper()
{
HKEY regKey;
RegOpenKeyEx(HKEY_CURRENT_USER, TEXT("Control Panel\\Desktop"), 0, KEY_ALL_ACCESS, &regKey);
if(g_placementSelection == PLACEMENT_TILE)
{
RegSetValueEx(regKey, TEXT("TileWallpaper"), 0, REG_SZ, (BYTE *)TEXT("1"), sizeof(TCHAR) * 2);
RegSetValueEx(regKey, TEXT("WallpaperStyle"), 0, REG_SZ, (BYTE *)TEXT("0"), sizeof(TCHAR) * 2);
}
if(g_placementSelection == PLACEMENT_CENTER)
{
RegSetValueEx(regKey, TEXT("TileWallpaper"), 0, REG_SZ, (BYTE *)TEXT("0"), sizeof(TCHAR) * 2);
RegSetValueEx(regKey, TEXT("WallpaperStyle"), 0, REG_SZ, (BYTE *)TEXT("0"), sizeof(TCHAR) * 2);
}
if(g_placementSelection == PLACEMENT_STRETCH)
{
RegSetValueEx(regKey, TEXT("TileWallpaper"), 0, REG_SZ, (BYTE *)TEXT("0"), sizeof(TCHAR) * 2);
RegSetValueEx(regKey, TEXT("WallpaperStyle"), 0, REG_SZ, (BYTE *)TEXT("2"), sizeof(TCHAR) * 2);
}
RegCloseKey(regKey);
if(g_wallpaperSelection == -1)
{
SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, TEXT(""), SPIF_UPDATEINIFILE);
}
else
{
SystemParametersInfo(SPI_SETDESKWALLPAPER,
0,
g_wallpapers[g_wallpaperSelection],
SPIF_UPDATEINIFILE);
}
}
INT_PTR CALLBACK BackgroundPageProc(HWND hwndDlg,
UINT uMsg,
WPARAM wParam,
LPARAM lParam)
{
g_hBackgroundTab = hwndDlg;
switch(uMsg)
{
case WM_INITDIALOG:
{
InitBackgroundDialog();
} break;
case WM_COMMAND:
{
DWORD controlId = LOWORD(wParam);
DWORD command = HIWORD(wParam);
switch(controlId)
{
case IDC_PATTERN:
{
if(command == BN_CLICKED)
OnPatternButton();
} break;
case IDC_BROWSE:
{
if(command == BN_CLICKED)
OnBrowseButton();
} break;
case IDC_PLACEMENT_COMBO:
{
if(command == CBN_SELCHANGE)
{
g_placementSelection = SendMessage(g_hPlacementCombo, CB_GETCURSEL, 0, 0);
InvalidateRect(g_hWallpaperPreview, NULL, TRUE);
PropSheet_Changed(GetParent(g_hBackgroundTab), g_hBackgroundTab);
}
} break;
}
} break;
case WM_DRAWITEM:
{
LPDRAWITEMSTRUCT drawItem;
drawItem = (LPDRAWITEMSTRUCT)lParam;
if(drawItem->CtlID == IDC_WALLPAPER_PREVIEW)
{
DrawWallpaperPreview(drawItem);
}
} break;
case WM_NOTIFY:
{
LPNMHDR lpnm = (LPNMHDR)lParam;
switch(lpnm->code)
{
case PSN_APPLY:
{
SetWallpaper();
/* Update the current wallapaper list item to the
* currently selected wallpaper */
LV_ITEM listItem;
listItem.mask = LVIF_PARAM;
listItem.iSubItem = 0;
listItem.iItem = g_currentWallpaperItemId;
listItem.lParam = g_wallpaperSelection;
ListView_SetItem(g_hWallpaperList, &listItem);
return TRUE;
} break;
case LVN_ITEMCHANGED:
{
LPNMLISTVIEW nm = (LPNMLISTVIEW)lParam;
if((nm->uNewState & LVIS_SELECTED) == 0)
return FALSE;
ListViewItemChanged(nm->iItem);
} break;
default:
break;
}
} break;
case WM_DESTROY:
{
if(g_pWallpaperBitmap != NULL)
DibFreeImage(g_pWallpaperBitmap);
} break;
}
return FALSE;
}

View file

@ -1,214 +1,128 @@
/*
* ReactOS
* Copyright (C) 2004 ReactOS Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* $Id$
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS Display Control Panel
* FILE: lib/cpl/desk/desk.c
* PURPOSE: ReactOS Display Control Panel
* PROGRAMMER: Gero Kuehn (reactos.filter@gkware.com)
* UPDATE HISTORY:
* 06-17-2004 Created
* 08-07-2004 Initial Checkin
*
* PROGRAMMERS: Trevor McCort (lycan359@gmail.com)
*/
#include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>
#include <tchar.h>
#include <windows.h>
#include <commctrl.h>
#include <cpl.h>
#include <process.h>
#include "resource.h"
#include "desk.h"
#define NUM_APPLETS (1)
LONG CALLBACK DisplayApplet(VOID);
INT_PTR CALLBACK BackgroundPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
INT_PTR CALLBACK ScreenSaverPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
INT_PTR CALLBACK AppearancePageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
INT_PTR CALLBACK SettingsPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
LONG APIENTRY DisplayApplet(HWND hwnd, UINT uMsg, LONG wParam, LONG lParam);
extern INT_PTR CALLBACK BackgroundPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
extern INT_PTR CALLBACK ScreenSaverPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
extern INT_PTR CALLBACK AppearancePageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
extern INT_PTR CALLBACK SettingsPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
HINSTANCE hApplet = 0;
/* Applets */
APPLET Applets[NUM_APPLETS] =
{
{IDI_CPLSYSTEM, IDS_CPLSYSTEMNAME, IDS_CPLSYSTEMDESCRIPTION, DisplayApplet}
{
IDC_DESK_ICON,
IDS_CPLNAME,
IDS_CPLDESCRIPTION,
DisplayApplet
}
};
/* Property page dialog callback */
INT_PTR CALLBACK
BackgroundPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
static VOID InitPropSheetPage(PROPSHEETPAGE *psp, WORD idDlg, DLGPROC DlgProc)
{
switch(uMsg)
{
case WM_INITDIALOG:
break;
case WM_COMMAND:
break;
}
return FALSE;
ZeroMemory(psp, sizeof(PROPSHEETPAGE));
psp->dwSize = sizeof(PROPSHEETPAGE);
psp->dwFlags = PSP_DEFAULT;
psp->hInstance = hApplet;
psp->pszTemplate = MAKEINTRESOURCE(idDlg);
psp->pfnDlgProc = DlgProc;
}
/* Property page dialog callback */
INT_PTR CALLBACK
ScreenSaverPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
/* Display Applet */
LONG APIENTRY DisplayApplet(HWND hwnd, UINT uMsg, LONG wParam, LONG lParam)
{
switch(uMsg)
{
case WM_INITDIALOG:
break;
case WM_COMMAND:
break;
}
return FALSE;
}
/* Property page dialog callback */
INT_PTR CALLBACK
AppearancePageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
switch(uMsg)
{
case WM_INITDIALOG:
break;
case WM_COMMAND:
break;
}
return FALSE;
}
/* Property page dialog callback */
INT_PTR CALLBACK
SettingsPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
switch(uMsg)
{
case WM_INITDIALOG:
break;
case WM_COMMAND:
break;
}
return FALSE;
}
static VOID
InitPropSheetPage(PROPSHEETPAGE *psp, WORD idDlg, DLGPROC DlgProc)
{
ZeroMemory(psp, sizeof(PROPSHEETPAGE));
psp->dwSize = sizeof(PROPSHEETPAGE);
psp->dwFlags = PSP_DEFAULT;
psp->hInstance = hApplet;
psp->pszTemplate = MAKEINTRESOURCE(idDlg);
psp->pfnDlgProc = DlgProc;
}
/* First Applet */
LONG CALLBACK
DisplayApplet(VOID)
{
PROPSHEETPAGE psp[4];
PROPSHEETHEADER psh;
TCHAR Caption[1024];
LoadString(hApplet, IDS_CPLSYSTEMNAME, Caption, sizeof(Caption) / sizeof(TCHAR));
ZeroMemory(&psh, sizeof(PROPSHEETHEADER));
psh.dwSize = sizeof(PROPSHEETHEADER);
psh.dwFlags = PSH_PROPSHEETPAGE | PSH_PROPTITLE;
psh.hwndParent = NULL;
psh.hInstance = hApplet;
psh.hIcon = LoadIcon(hApplet, MAKEINTRESOURCE(IDI_CPLSYSTEM));
psh.pszCaption = Caption;
psh.nPages = sizeof(psp) / sizeof(PROPSHEETPAGE);
psh.nStartPage = 0;
psh.ppsp = psp;
psh.pfnCallback = NULL;
InitPropSheetPage(&psp[0], IDD_PROPPAGEBACKGROUND, BackgroundPageProc);
InitPropSheetPage(&psp[1], IDD_PROPPAGESCREENSAVER, ScreenSaverPageProc);
InitPropSheetPage(&psp[2], IDD_PROPPAGEAPPEARANCE, AppearancePageProc);
InitPropSheetPage(&psp[3], IDD_PROPPAGESETTINGS, SettingsPageProc);
return (LONG)(PropertySheet(&psh) != -1);
PROPSHEETPAGE psp[4];
PROPSHEETHEADER psh;
TCHAR Caption[1024];
LoadString(hApplet, IDS_CPLNAME, Caption, sizeof(Caption) / sizeof(TCHAR));
ZeroMemory(&psh, sizeof(PROPSHEETHEADER));
psh.dwSize = sizeof(PROPSHEETHEADER);
psh.dwFlags = PSH_PROPSHEETPAGE | PSH_USECALLBACK | PSH_PROPTITLE;
psh.hwndParent = NULL;
psh.hInstance = hApplet;
psh.hIcon = LoadIcon(hApplet, MAKEINTRESOURCE(IDC_DESK_ICON));
psh.pszCaption = Caption;
psh.nPages = sizeof(psp) / sizeof(PROPSHEETPAGE);
psh.nStartPage = 0;
psh.ppsp = psp;
InitPropSheetPage(&psp[0], IDD_BACKGROUND, BackgroundPageProc);
InitPropSheetPage(&psp[1], IDD_SCREENSAVER, ScreenSaverPageProc);
InitPropSheetPage(&psp[2], IDD_APPEARANCE, AppearancePageProc);
InitPropSheetPage(&psp[3], IDD_SETTINGS, SettingsPageProc);
return (LONG)(PropertySheet(&psh) != -1);
}
/* Control Panel Callback */
LONG CALLBACK
CPlApplet(HWND hwndCPl, UINT uMsg, LPARAM lParam1, LPARAM lParam2)
LONG CALLBACK CPlApplet(HWND hwndCPl, UINT uMsg, LPARAM lParam1, LPARAM lParam2)
{
int i = (int)lParam1;
switch(uMsg)
{
case CPL_INIT:
{
return TRUE;
}
case CPL_GETCOUNT:
{
return NUM_APPLETS;
}
case CPL_INQUIRE:
{
CPLINFO *CPlInfo = (CPLINFO*)lParam2;
CPlInfo->lData = 0;
CPlInfo->idIcon = Applets[i].idIcon;
CPlInfo->idName = Applets[i].idName;
CPlInfo->idInfo = Applets[i].idDescription;
break;
}
case CPL_DBLCLK:
{
Applets[i].AppletProc();
break;
}
}
return FALSE;
int i = (int)lParam1;
switch(uMsg)
{
case CPL_INIT:
{
return TRUE;
}
case CPL_GETCOUNT:
{
return NUM_APPLETS;
}
case CPL_INQUIRE:
{
CPLINFO *CPlInfo = (CPLINFO*)lParam2;
CPlInfo->lData = 0;
CPlInfo->idIcon = Applets[i].idIcon;
CPlInfo->idName = Applets[i].idName;
CPlInfo->idInfo = Applets[i].idDescription;
} break;
case CPL_DBLCLK:
{
Applets[i].AppletProc(hwndCPl, uMsg, lParam1, lParam2);
} break;
}
return FALSE;
}
BOOL WINAPI
DllMain(HINSTANCE hinstDLL, DWORD dwReason, LPVOID lpvReserved)
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD dwReason, LPVOID lpvReserved)
{
switch(dwReason)
{
case DLL_PROCESS_ATTACH:
case DLL_THREAD_ATTACH:
hApplet = hinstDLL;
break;
}
return TRUE;
switch(dwReason)
{
case DLL_PROCESS_ATTACH:
case DLL_THREAD_ATTACH:
{
hApplet = hinstDLL;
} break;
}
return TRUE;
}

View file

@ -1,124 +0,0 @@
# Microsoft Developer Studio Project File - Name="desk" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
CFG=desk - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "desk.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "desk.mak" CFG="desk - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "desk - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE "desk - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
MTL=midl.exe
RSC=rc.exe
!IF "$(CFG)" == "desk - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Ignore_Export_Lib 1
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "desk_EXPORTS" /YX /FD /c
# ADD CPP /nologo /MT /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_USRDLL" /D "desk_EXPORTS" /D "_UNICODE" /D "UNICODE" /YX /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x407 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG" /d "_MSC_VER"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib /nologo /dll /machine:I386 /out:"Release/desk.cpl"
!ELSEIF "$(CFG)" == "desk - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Ignore_Export_Lib 1
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "desk_EXPORTS" /YX /FD /GZ /c
# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_USRDLL" /D "desk_EXPORTS" /D "_UNICODE" /D "UNICODE" /YX /FD /GZ /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x407 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG" /d "_MSC_VER"
# SUBTRACT RSC /x
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib /nologo /dll /debug /machine:I386 /out:"Debug/desk.cpl" /pdbtype:sept
!ENDIF
# Begin Target
# Name "desk - Win32 Release"
# Name "desk - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=.\desk.c
# End Source File
# Begin Source File
SOURCE=.\desk.h
# End Source File
# Begin Source File
SOURCE=.\resource.h
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=.\desk.def
# End Source File
# Begin Source File
SOURCE=.\desk.rc
# End Source File
# End Group
# Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# End Group
# End Target
# End Project

View file

@ -1,29 +0,0 @@
Microsoft Developer Studio Workspace File, Format Version 6.00
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
###############################################################################
Project: "desk"=.\desk.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Global:
Package=<5>
{{{
}}}
Package=<3>
{{{
}}}
###############################################################################

View file

@ -1,20 +1,17 @@
#ifndef __CPL_APPWIZ_H
#define __CPL_APPWIZ_H
typedef LONG (CALLBACK *CPLAPPLET_PROC)(VOID);
#ifndef __CPL_DESK_H__
#define __CPL_DESK_H__
typedef struct
{
int idIcon;
int idName;
int idDescription;
CPLAPPLET_PROC AppletProc;
int idIcon;
int idName;
int idDescription;
APPLET_PROC AppletProc;
} APPLET, *PAPPLET;
extern HINSTANCE hApplet;
void ShowLastWin32Error(HWND hWndOwner);
#endif /* __CPL_DESK_H__ */
#endif /* __CPL_APPWIZ_H */
/* EOF */

View file

@ -1,119 +1,16 @@
#include <windows.h>
#include "resource.h"
#ifdef _MSC_VER
#include <../../../include/defines.h>
#else
#include <defines.h>
#endif
LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
#define REACTOS_VERSION_DLL
#define REACTOS_STR_FILE_DESCRIPTION "ReactOS Display Panel\0"
#define REACTOS_STR_INTERNAL_NAME "desk\0"
#define REACTOS_STR_ORIGINAL_FILENAME "desk.cpl\0"
#ifdef _MSC_VER
#include <../../../include/reactos/version.rc>
#else
#define REACTOS_STR_FILE_DESCRIPTION "ReactOS Display Panel\0"
#define REACTOS_STR_INTERNAL_NAME "desk\0"
#define REACTOS_STR_ORIGINAL_FILENAME "desk.cpl\0"
#include <reactos/version.rc>
#endif
IDD_PROPPAGEBACKGROUND DIALOGEX 0, 0, 246, 228
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION
CAPTION "Background"
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
GROUPBOX "&Pattern",1001,5,118,115,92
LISTBOX 1002,11,130,103,42,LBS_SORT | LBS_NOINTEGRALHEIGHT |
WS_VSCROLL | WS_TABSTOP
PUSHBUTTON "&Edit Pattern...",1003,53,175,61,14
GROUPBOX "&Wallpaper",1004,127,118,115,92
LISTBOX 1005,133,130,103,42,LBS_SORT | LBS_NOINTEGRALHEIGHT |
WS_VSCROLL | WS_TABSTOP
PUSHBUTTON "&Browse...",1006,174,175,61,14
LTEXT "&Position:",1007,134,196,28,8
COMBOBOX 1008,169,193,67,30,CBS_DROPDOWN | CBS_SORT | WS_VSCROLL |
WS_TABSTOP
END
IDC_DESK_ICON ICON "resources/applet.ico"
IDD_PROPPAGESCREENSAVER DIALOGEX 0, 0, 246, 228
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION
CAPTION "Screen Saver"
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
GROUPBOX "&Screen Saver",200,4,129,238,48
COMBOBOX 1000,10,140,115,200,CBS_DROPDOWNLIST | CBS_SORT |
WS_VSCROLL | WS_GROUP | WS_TABSTOP
PUSHBUTTON "Se&ttings...",1003,130,139,50,14,WS_GROUP
PUSHBUTTON "Pre&view",1004,183,139,50,14
CONTROL "&Lock desktop on resume",1020,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,13,157,112,9
LTEXT "&Wait:",1016,151,160,17,9
EDITTEXT 1006,170,158,30,12,ES_RIGHT | WS_GROUP
CONTROL "",1007,"msctls_updown32",UDS_SETBUDDYINT |
UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS |
UDS_NOTHOUSANDS | WS_BORDER | WS_GROUP,203,158,11,12
LTEXT "minutes",1022,204,160,28,9
GROUPBOX "Energy saving features of monitor",1017,4,179,238,33
PUSHBUTTON "P&ower...",1014,175,190,50,14
LTEXT "To adjust the power settings for your monitor, click Power.",
1018,19,190,155,16
CONTROL "",1002,"Static",SS_BITMAP | SS_CENTERIMAGE,60,11,125,
107
END
#include "en.rc"
IDD_PROPPAGEAPPEARANCE DIALOGEX 0, 0, 246, 228
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION
CAPTION "Appearance"
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
LTEXT "&Color Scheme:",-1,3,130,30,9
COMBOBOX 1400,3,140,131,200,CBS_DROPDOWNLIST | CBS_SORT |
WS_VSCROLL | WS_TABSTOP
PUSHBUTTON "Sa&ve As...",1401,138,140,50,14
PUSHBUTTON "&Delete",1402,191,140,50,14
LTEXT "&Item:",-1,3,159,26,9
COMBOBOX 1403,3,169,131,200,CBS_DROPDOWNLIST | CBS_SORT |
WS_VSCROLL | WS_TABSTOP
LTEXT "Si&ze:",1450,138,159,16,9
EDITTEXT 1404,138,169,38,13,ES_RIGHT | WS_GROUP
CONTROL "",1411,"msctls_updown32",UDS_SETBUDDYINT |
UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS |
WS_BORDER | WS_GROUP,168,169,10,13
LTEXT "Co&lor:",1451,180,159,20,9
LTEXT "Color &2:",1455,212,159,28,9
LTEXT "&Font:",1452,3,188,20,9
COMBOBOX 1407,3,198,131,200,CBS_DROPDOWN | CBS_SORT | WS_VSCROLL |
WS_TABSTOP
LTEXT "Siz&e:",1454,138,188,17,8
COMBOBOX 1408,138,198,38,200,CBS_DROPDOWN | CBS_SORT | WS_VSCROLL |
WS_TABSTOP
LTEXT "Colo&r:",1453,180,188,20,9
CHECKBOX "B",1409,212,198,14,13,BS_PUSHLIKE
CHECKBOX "I",1410,226,198,14,13,BS_PUSHLIKE
END
IDD_PROPPAGESETTINGS DIALOGEX 0, 0, 246, 228
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION
CAPTION "Settings"
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
LTEXT "&Display:",1820,3,140,30,8
GROUPBOX "&Colors",1817,3,160,115,43
COMBOBOX 1807,9,170,103,80,CBS_DROPDOWNLIST | CBS_AUTOHSCROLL |
CBS_SORT | WS_VSCROLL | WS_TABSTOP
CONTROL "",1813,"Static",SS_BITMAP | SS_CENTERIMAGE | SS_SUNKEN,
9,188,103,9
GROUPBOX "&Screen area",1818,125,160,115,43
CONTROL "",1808,"msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP,
152,170,58,17
LTEXT "Less",1815,131,170,15,8,NOT WS_GROUP
LTEXT "More",1816,215,170,21,8,NOT WS_GROUP
CTEXT "640 X 480 pixels",1814,132,190,100,10,NOT WS_GROUP
PUSHBUTTON "Ad&vanced...",1802,184,205,56,14
LTEXT "<none>",1050,19,149,224,8
END
STRINGTABLE
BEGIN
IDS_CPLSYSTEMNAME "Display"
IDS_CPLSYSTEMDESCRIPTION "Customizes your desktop display and screen saver."
END

View file

@ -0,0 +1,92 @@
/* $Id$
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS Display Control Panel
* FILE: lib/cpl/desk/dibitmap.c
* PURPOSE: DIB loading
*
* PROGRAMMERS: Trevor McCort (lycan359@gmail.com)
*/
#include "dibitmap.h"
DIBitmap *DibLoadImage(TCHAR *filename)
{
BOOL bSuccess;
DWORD dwFileSize, dwHighSize, dwBytesRead;
HANDLE hFile;
DIBitmap *bitmap;
hFile = CreateFile(filename,
GENERIC_READ,
FILE_SHARE_READ,
NULL,
OPEN_EXISTING,
FILE_FLAG_SEQUENTIAL_SCAN,
NULL);
if(hFile == INVALID_HANDLE_VALUE)
return NULL;
dwFileSize = GetFileSize(hFile, &dwHighSize);
if(dwHighSize)
{
CloseHandle(hFile);
return NULL;
}
bitmap = malloc(sizeof(DIBitmap));
if(!bitmap)
return NULL;
bitmap->header = malloc(dwFileSize);
if(!bitmap->header)
{
CloseHandle(hFile);
return NULL;
}
bSuccess = ReadFile(hFile, bitmap->header, dwFileSize, &dwBytesRead, NULL);
CloseHandle(hFile);
if(!bSuccess || (dwBytesRead != dwFileSize)
|| (bitmap->header->bfType != * (WORD *) "BM")
|| (bitmap->header->bfSize != dwFileSize))
{
free(bitmap->header);
return NULL;
}
bitmap->info = (BITMAPINFO *)(bitmap->header + 1);
bitmap->bits = (BYTE *)bitmap->header + bitmap->header->bfOffBits;
/* Get the DIB width and height */
if(bitmap->info->bmiHeader.biSize == sizeof(BITMAPCOREHEADER))
{
bitmap->width = ((BITMAPCOREHEADER *)bitmap->info)->bcWidth;
bitmap->height = ((BITMAPCOREHEADER *)bitmap->info)->bcHeight;
}
else
{
bitmap->width = bitmap->info->bmiHeader.biWidth;
bitmap->height = abs(bitmap->info->bmiHeader.biHeight);
}
return bitmap;
}
void DibFreeImage(DIBitmap *bitmap)
{
if(bitmap == NULL)
return;
/* Free the header */
if(bitmap->header != NULL)
free(bitmap->header);
/* Free the bitmap structure */
if(bitmap != NULL)
free(bitmap);
}

View file

@ -0,0 +1,22 @@
#ifndef __DIBITMAP_H__
#define __DIBITMAP_H__
#include <windows.h>
typedef struct
{
BITMAPFILEHEADER *header;
BITMAPINFO *info;
BYTE *bits;
int width;
int height;
} DIBitmap;
extern DIBitmap *DibLoadImage(TCHAR *filename);
extern void DibFreeImage(DIBitmap *bitmap);
#endif /* __DIBITMAP_H__ */

View file

@ -0,0 +1,59 @@
LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT
IDD_BACKGROUND DIALOGEX DISCARDABLE 0, 0, 246, 228
STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION
CAPTION "Background"
FONT 8, "MS Shell Dlg"
BEGIN
CONTROL "",IDC_WALLPAPER_PREVIEW,"Static",SS_OWNERDRAW,48,10,
150,105,WS_EX_STATICEDGE
CONTROL "",IDC_WALLPAPER_LIST,"SysListView32",LVS_REPORT |
LVS_SINGLESEL | LVS_NOCOLUMNHEADER | LVS_SHAREIMAGELISTS |
WS_BORDER | WS_TABSTOP,7,139,173,71
LTEXT "Select an image to use as your desktop wallpaper:",
IDC_STATIC,8,127,180,8
PUSHBUTTON "&Browse...",IDC_BROWSE,187,175,50,14
PUSHBUTTON "&Pattern...",IDC_PATTERN,187,195,50,14
LTEXT "Placement:",IDC_STATIC,187,138,36,8
COMBOBOX IDC_PLACEMENT_COMBO,187,148,50,90,CBS_DROPDOWNLIST |
CBS_SORT | WS_VSCROLL | WS_TABSTOP
END
IDD_SCREENSAVER DIALOGEX DISCARDABLE 0, 0, 246, 228
STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION
CAPTION "Screen Saver"
FONT 8, "MS Shell Dlg"
BEGIN
LTEXT "This space is intentionally left blank",IDC_STATIC,66,
110,112,8
END
IDD_APPEARANCE DIALOGEX DISCARDABLE 0, 0, 246, 228
STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION
CAPTION "Appearance"
FONT 8, "MS Shell Dlg"
BEGIN
LTEXT "This space is intentionally left blank",IDC_STATIC,66,
110,112,8
END
IDD_SETTINGS DIALOGEX DISCARDABLE 0, 0, 246, 228
STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION
CAPTION "Settings"
FONT 8, "MS Shell Dlg"
BEGIN
LTEXT "This space is intentionally left blank",IDC_STATIC,66,
110,112,8
END
STRINGTABLE
BEGIN
IDS_CPLNAME "Display"
IDS_CPLDESCRIPTION "Customizes the desktop display and screen saver."
IDS_NONE "(None)"
IDS_CENTER "Center"
IDS_STRETCH "Stretch"
IDS_TILE "Tile"
END

View file

@ -1,33 +1,37 @@
#ifndef __CPL_RESOURCE_H
#define __CPL_RESOURCE_H
#ifndef __CPL_DESK_RESOURCE_H__
#define __CPL_DESK_RESOURCE_H__
/* metrics */
#define PROPSHEETWIDTH 246
#define PROPSHEETHEIGHT 228
#define PROPSHEETPADDING 6
#define SYSTEM_COLUMN (0 * PROPSHEETPADDING)
// this is not supported by the MS Resource compiler:
//#define LABELLINE(x) 0 //(((PROPSHEETPADDING + 2) * x) + (x + 2))
#define PROPSHEETWIDTH 246
#define PROPSHEETHEIGHT 228
#define PROPSHEETPADDING 6
#define ICONSIZE 16
#define SYSTEM_COLUMN (18 * PROPSHEETPADDING)
#define LABELLINE(x) (((PROPSHEETPADDING + 2) * x) + (x + 2))
#define ICONSIZE 16
/* ids */
#define IDC_DESK_ICON 1
#define IDI_CPLSYSTEM 100
#define IDD_BACKGROUND 100
#define IDD_SCREENSAVER 101
#define IDD_APPEARANCE 102
#define IDD_SETTINGS 103
#define IDC_WALLPAPER_LIST 1000
#define IDC_BROWSE 1001
#define IDC_PATTERN 1002
#define IDC_PLACEMENT_COMBO 1003
#define IDC_WALLPAPER_PREVIEW 1004
#define IDC_STATIC -1
#define IDD_PROPPAGEBACKGROUND 100
#define IDD_PROPPAGESCREENSAVER 101
#define IDD_PROPPAGEAPPEARANCE 102
#define IDD_PROPPAGESETTINGS 103
#define IDS_CPLNAME 2000
#define IDS_CPLDESCRIPTION 2001
#define IDS_CPLSYSTEMNAME 1001
#define IDS_CPLSYSTEMDESCRIPTION 2001
#define IDS_NONE 2002
#define IDS_CENTER 2003
#define IDS_STRETCH 2004
#define IDS_TILE 2005
/* controls */
#define IDC_INSTALL 101
#define IDC_SOFTWARELIST 102
#define IDC_ADDREMOVE 103
#endif /* __CPL_DESK_RESOURCE_H__ */
#endif /* __CPL_RESOURCE_H */
/* EOF */

View file

@ -0,0 +1,34 @@
/* $Id$
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS Display Control Panel
* FILE: lib/cpl/desk/screensaver.c
* PURPOSE: Screen saver property page
*
* PROGRAMMERS: Trevor McCort (lycan359@gmail.com)
*/
#include <windows.h>
#include <commctrl.h>
#include "resource.h"
INT_PTR CALLBACK ScreenSaverPageProc(HWND hwndDlg,
UINT uMsg,
WPARAM wParam,
LPARAM lParam)
{
switch(uMsg)
{
case WM_INITDIALOG:
{
} break;
case WM_COMMAND:
{
} break;
}
return FALSE;
}

View file

@ -0,0 +1,34 @@
/* $Id$
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS Display Control Panel
* FILE: lib/cpl/desk/settings.c
* PURPOSE: Settings property page
*
* PROGRAMMERS: Trevor McCort (lycan359@gmail.com)
*/
#include <windows.h>
#include <commctrl.h>
#include "resource.h"
INT_PTR CALLBACK SettingsPageProc(HWND hwndDlg,
UINT uMsg,
WPARAM wParam,
LPARAM lParam)
{
switch(uMsg)
{
case WM_INITDIALOG:
{
} break;
case WM_COMMAND:
{
} break;
}
return FALSE;
}