Paint: Added cropping via attributes dialog and setting desktop wallpaper (both not...
[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
13 /* FUNCTIONS ********************************************************/
14
15 void setWallpaper(char fname[], int style)
16 {
17 HKEY hkeycontrolpanel;
18 HKEY hkeydesktop;
19 RegOpenKeyEx(HKEY_CURRENT_USER, "Control Panel", 0, 0, hkeycontrolpanel);
20 RegOpenKeyEx(hkeycontrolpanel, "Desktop", 0, KEY_SET_VALUE, hkeydesktop);
21 RegSetValueEx(hkeydesktop, "Wallpaper", 0, REG_SZ, fname, sizeof(fname));
22 switch (style)
23 {
24 case 0:
25 RegSetValueEx(hkeydesktop, "WallpaperStyle", 0, REG_SZ, "2", 2);
26 RegSetValueEx(hkeydesktop, "TileWallpaper", 0, REG_SZ, "0", 2);
27 break;
28 case 1:
29 RegSetValueEx(hkeydesktop, "WallpaperStyle", 0, REG_SZ, "1", 2);
30 RegSetValueEx(hkeydesktop, "TileWallpaper", 0, REG_SZ, "0", 2);
31 break;
32 case 2:
33 RegSetValueEx(hkeydesktop, "WallpaperStyle", 0, REG_SZ, "1", 2);
34 RegSetValueEx(hkeydesktop, "TileWallpaper", 0, REG_SZ, "1", 2);
35 break;
36 }
37 RegCloseKey(hkeydesktop);
38 RegCloseKey(hkeycontrolpanel);
39 }