2009-05-29 19:36:35 +00:00
|
|
|
/*
|
|
|
|
* PROJECT: PAINT for ReactOS
|
|
|
|
* LICENSE: LGPL
|
2009-10-21 15:44:31 +00:00
|
|
|
* FILE: base/applications/paint/registry.c
|
2009-05-29 19:36:35 +00:00
|
|
|
* PURPOSE: Offering functions dealing with registry values
|
|
|
|
* PROGRAMMERS: Benedikt Freisen
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* INCLUDES *********************************************************/
|
|
|
|
|
|
|
|
#include <windows.h>
|
2009-06-15 15:04:56 +00:00
|
|
|
#include <tchar.h>
|
2009-05-29 19:36:35 +00:00
|
|
|
|
|
|
|
/* FUNCTIONS ********************************************************/
|
|
|
|
|
2009-10-21 15:44:31 +00:00
|
|
|
void
|
|
|
|
SetWallpaper(TCHAR * FileName, DWORD dwStyle, DWORD dwTile) //FIXME: The pattern (tiled/stretched) is not set
|
2009-05-29 19:36:35 +00:00
|
|
|
{
|
2009-10-03 16:33:41 +00:00
|
|
|
SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, (PVOID) FileName, SPIF_UPDATEINIFILE);
|
2009-10-21 15:44:31 +00:00
|
|
|
|
2009-10-03 16:33:41 +00:00
|
|
|
/*HKEY hDesktop;
|
2009-06-15 15:04:56 +00:00
|
|
|
TCHAR szStyle[3], szTile[3];
|
|
|
|
|
|
|
|
if ((dwStyle > 2) || (dwTile > 2))
|
|
|
|
return;
|
|
|
|
|
2009-10-21 15:44:31 +00:00
|
|
|
if (RegOpenKeyEx(HKEY_CURRENT_USER,
|
|
|
|
_T("Control Panel\\Desktop"), 0, KEY_READ | KEY_SET_VALUE, &hDesktop) == ERROR_SUCCESS)
|
2009-05-29 19:36:35 +00:00
|
|
|
{
|
2009-10-21 15:44:31 +00:00
|
|
|
RegSetValueEx(hDesktop, _T("Wallpaper"), 0, REG_SZ, (LPBYTE) FileName,
|
|
|
|
_tcslen(FileName) * sizeof(TCHAR));
|
2009-06-15 15:04:56 +00:00
|
|
|
|
|
|
|
_stprintf(szStyle, _T("%i"), dwStyle);
|
2009-10-21 15:44:31 +00:00
|
|
|
_stprintf(szTile, _T("%i"), dwTile);
|
2009-06-15 15:04:56 +00:00
|
|
|
|
2009-10-21 15:44:31 +00:00
|
|
|
RegSetValueEx(hDesktop, _T("WallpaperStyle"), 0, REG_SZ, (LPBYTE) szStyle,
|
|
|
|
_tcslen(szStyle) * sizeof(TCHAR));
|
|
|
|
RegSetValueEx(hDesktop, _T("TileWallpaper"), 0, REG_SZ, (LPBYTE) szTile,
|
|
|
|
_tcslen(szTile) * sizeof(TCHAR));
|
2009-06-15 15:04:56 +00:00
|
|
|
|
|
|
|
RegCloseKey(hDesktop);
|
2009-10-03 16:33:41 +00:00
|
|
|
}*/
|
2009-05-29 19:36:35 +00:00
|
|
|
}
|