Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygenregistry.c
Go to the documentation of this file.
00001 /* 00002 * PROJECT: PAINT for ReactOS 00003 * LICENSE: LGPL 00004 * FILE: base/applications/paint/registry.c 00005 * PURPOSE: Offering functions dealing with registry values 00006 * PROGRAMMERS: Benedikt Freisen 00007 */ 00008 00009 /* INCLUDES *********************************************************/ 00010 00011 #include "precomp.h" 00012 00013 /* FUNCTIONS ********************************************************/ 00014 00015 void 00016 SetWallpaper(TCHAR * FileName, DWORD dwStyle, DWORD dwTile) //FIXME: Has to be called 2x to apply the pattern (tiled/stretched) too 00017 { 00018 HKEY hDesktop; 00019 TCHAR szStyle[3], szTile[3]; 00020 00021 SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, (PVOID) FileName, SPIF_UPDATEINIFILE); 00022 00023 if ((dwStyle > 2) || (dwTile > 2)) 00024 return; 00025 00026 if (RegOpenKeyEx(HKEY_CURRENT_USER, 00027 _T("Control Panel\\Desktop"), 0, KEY_READ | KEY_SET_VALUE, &hDesktop) == ERROR_SUCCESS) 00028 { 00029 RegSetValueEx(hDesktop, _T("Wallpaper"), 0, REG_SZ, (LPBYTE) FileName, 00030 _tcslen(FileName) * sizeof(TCHAR)); 00031 00032 _stprintf(szStyle, _T("%i"), dwStyle); 00033 _stprintf(szTile, _T("%i"), dwTile); 00034 00035 RegSetValueEx(hDesktop, _T("WallpaperStyle"), 0, REG_SZ, (LPBYTE) szStyle, 00036 _tcslen(szStyle) * sizeof(TCHAR)); 00037 RegSetValueEx(hDesktop, _T("TileWallpaper"), 0, REG_SZ, (LPBYTE) szTile, 00038 _tcslen(szTile) * sizeof(TCHAR)); 00039 00040 RegCloseKey(hDesktop); 00041 } 00042 } Generated on Sun May 27 2012 04:17:06 for ReactOS by
1.7.6.1
|