일부 발췌 : 윈도우 7에서
, 시스템에 하나의 바탕 화면 파일이 있습니다. 따라서 우리는 현재 배경 화면을 임시 파일에 저장하고 바탕 화면을 우리의 이미지로 대체합니다. 나중에 우리는 원본 파일 복원
// Get the system's wallpaper filename from the registry
GetRegKeyStrHK(HKEY_CURRENT_USER, "Control Panel\\Desktop","WallPaper", szFilename, sizeof(szFilename));
// Now copy that file to a temporary file
CopyFile(szFilename, "C:\\myTmpWallpaper.bmp",FALSE);
// Then tell the system to use a new file (it will copy it to the old filename)
SystemParametersInfo (SPI_SETDESKWALLPAPER, 0, (LPSTR) szMyDesktopImage, 0);
기능 GetRegKeyStrHK()
내 라이브러리입니다 그것은 레지스트리 값 (벽지 파일 이름)을 가져옵니다.
int GetRegKeyStrHK (HKEY hK, const char *szRoot, const char *szName, char *szValue, int iValueSize)
{
HKEY hkResult;
int iKeyType, bufsize, result;
if (RegOpenKeyEx(hK, szRoot, 0, KEY_READ, &hkResult)
!= ERROR_SUCCESS) return(FALSE); // no such key
bufsize=iValueSize;
result= RegQueryValueEx(hkResult,szName,0, &iKeyType, (BYTE *)szValue, &bufsize);
RegCloseKey (hkResult);
if (result != ERROR_SUCCESS) return(FALSE); // no such name/value pair or buffer too small
return (TRUE);
}
http://superuser.com/questions/153075/setting-an-animated-gif-as-the-desktop-background-on-windows-7 – user463035818
[SystemParametersInfo]를 사용하여 일부 속임수 (https://msdn.microsoft.com/en-us/library/windows/desktop/ms724947(v=vs.85).aspx)는 과거에 어떻게 진행되었는지 보았습니다. 몇 가지 google-fu를 치고 당신이 무엇을 발견하는지보십시오. – WhozCraig