d9ec178671bdc00d248c7ae9fa29f73637c181b2
[reactos.git] / reactos / base / applications / paint / registry.c
1 /*
2 * PROJECT: PAINT for ReactOS
3 * LICENSE: LGPL
4 * FILE: registry.c
5 * PURPOSE: Offering functions dealing with registry values
6 * PROGRAMMERS: Benedikt Freisen
7 */
8
9 /* INCLUDES *********************************************************/
10
11 #include <windows.h>
12 #include <tchar.h>
13
14 /* FUNCTIONS ********************************************************/
15
16 void SetWallpaper(TCHAR *FileName, DWORD dwStyle, DWORD dwTile) //FIXME: The pattern (tiled/stretched) is not set
17 {
18 SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, (PVOID) FileName, SPIF_UPDATEINIFILE);
19
20 /*HKEY hDesktop;
21 TCHAR szStyle[3], szTile[3];
22
23 if ((dwStyle > 2) || (dwTile > 2))
24 return;
25
26 if (RegOpenKeyEx(HKEY_CURRENT_USER,
27 _T("Control Panel\\Desktop"), 0,
28 KEY_READ | KEY_SET_VALUE, &hDesktop) == ERROR_SUCCESS)
29 {
30 RegSetValueEx(hDesktop, _T("Wallpaper"), 0, REG_SZ, (LPBYTE) FileName, _tcslen(FileName) * sizeof(TCHAR));
31
32 _stprintf(szStyle, _T("%i"), dwStyle);
33 _stprintf(szTile, _T("%i"), dwTile);
34
35 RegSetValueEx(hDesktop, _T("WallpaperStyle"), 0, REG_SZ, (LPBYTE) szStyle, _tcslen(szStyle) * sizeof(TCHAR));
36 RegSetValueEx(hDesktop, _T("TileWallpaper"), 0, REG_SZ, (LPBYTE) szTile, _tcslen(szTile) * sizeof(TCHAR));
37
38 RegCloseKey(hDesktop);
39 }*/
40 }