16#define MAX_BACKGROUNDS 100
101 if (!
_wcsicmp(codecInfo[
i].MimeType, MimeType))
103 *pClsid = codecInfo[
i].
Clsid;
226 backgroundItem = &
pData->backgroundItems[
pData->listViewItemCount];
252 listItem.iImage = sfi.
iIcon;
253 listItem.iItem =
pData->listViewItemCount;
254 listItem.lParam =
pData->listViewItemCount;
258 pData->listViewItemCount++;
294 HWND hwndBackgroundList;
309#define IDI_SHELL_NO 200
324 backgroundItem = &
pData->backgroundItems[
pData->listViewItemCount];
336 listItem.iItem =
pData->listViewItemCount;
337 listItem.lParam =
pData->listViewItemCount;
342 pData->listViewItemCount,
346 pData->listViewItemCount++;
366 hr =
StringCbCopy(wallpaperFilename,
sizeof(wallpaperFilename), originalWallpaper);
396 backgroundItem = &
pData->backgroundItems[
pData->listViewItemCount];
420 listItem.iImage = sfi.
iIcon;
421 listItem.iItem =
pData->listViewItemCount;
422 listItem.lParam =
pData->listViewItemCount;
426 pData->listViewItemCount,
430 pData->listViewItemCount++;
513 if (
_ttoi(szBuffer) == 1)
549 cc.hwndOwner = hwndDlg;
552 cc.lpCustColors =
pData->custom_colors;
597 lvfi.psz = tszFileName;
613 TCHAR fileTitle[256];
620 HWND hwndBackgroundList;
648 buffersize = (
_tcslen(extensions) * 2 + 6) *
sizeof(
TCHAR) +
sizeof(filterdesc);
657 sizeRemain = buffersize;
668 sizeRemain -=
sizeof(*c);
709 backgroundItem = &
pData->backgroundItems[
pData->listViewItemCount];
727 listItem.iImage = sfi.
iIcon;
728 listItem.iItem =
pData->listViewItemCount;
729 listItem.lParam =
pData->listViewItemCount;
733 pData->listViewItemCount,
738 pData->listViewItemCount++;
748 pData->backgroundSelection = itemIndex;
749 backgroundItem = &
pData->backgroundItems[
pData->backgroundSelection];
786 int fitFillScaleNum, fitFillScaleDen;
787 int fitFillWidth, fitFillHeight;
803 if (
pData->backgroundItems[
pData->backgroundSelection].bWallpaper ==
FALSE)
816 scaledWidth = (
int)(
pData->pWallpaperBitmap->width / scaleX);
817 scaledHeight = (
int)(
pData->pWallpaperBitmap->height / scaleY);
823 switch (
pData->placementSelection)
831 if (posX < 0) { desX = -posX / 2; posX = 0; }
832 if (posY < 0) { desY = -posY / 2; posY = 0; }
847 pData->pWallpaperBitmap->width - (
int)(desX * scaleX),
848 pData->pWallpaperBitmap->height - (
int)(desY * scaleY),
849 pData->pWallpaperBitmap->bits,
850 pData->pWallpaperBitmap->info,
863 pData->pWallpaperBitmap->width,
864 pData->pWallpaperBitmap->height,
865 pData->pWallpaperBitmap->bits,
866 pData->pWallpaperBitmap->info,
894 pData->pWallpaperBitmap->width * posX / scaledWidth,
895 pData->pWallpaperBitmap->height * posY / scaledHeight,
896 pData->pWallpaperBitmap->bits,
897 pData->pWallpaperBitmap->info,
910 fitFillScaleDen = scaledWidth;
915 fitFillScaleDen = scaledHeight;
918 fitFillWidth =
MulDiv(scaledWidth, fitFillScaleNum, fitFillScaleDen);
919 fitFillHeight =
MulDiv(scaledHeight, fitFillScaleNum, fitFillScaleDen);
931 pData->pWallpaperBitmap->width,
932 pData->pWallpaperBitmap->height,
933 pData->pWallpaperBitmap->bits,
934 pData->pWallpaperBitmap->info,
943 fitFillScaleDen = scaledWidth;
948 fitFillScaleDen = scaledHeight;
951 fitFillWidth =
MulDiv(scaledWidth, fitFillScaleNum, fitFillScaleDen);
952 fitFillHeight =
MulDiv(scaledHeight, fitFillScaleNum, fitFillScaleDen);
954 desX = (((fitFillWidth -
MONITOR_WIDTH) *
pData->pWallpaperBitmap->width) / (2 * fitFillWidth));
955 desY = (((fitFillHeight -
MONITOR_HEIGHT) *
pData->pWallpaperBitmap->height) / (2 * fitFillHeight));
966 pData->pWallpaperBitmap->bits,
967 pData->pWallpaperBitmap->info,
1045 if (
pData->backgroundItems[
pData->backgroundSelection].bWallpaper !=
FALSE)
1083 TEXT(
"ConvertedWallpaper"),
1093 TEXT(
"OriginalWallpaper"),
1258 if (
pData->bWallpaperChanged)
1260 if (
pData->bClrBackgroundChanged)
1262 if (
pData->desktopData.bSettingsChanged)
static VOID OnBrowseButton(HWND hwndDlg, PBACKGROUND_DATA pData)
static VOID InitBackgroundDialog(HWND hwndDlg, PBACKGROUND_DATA pData)
struct _BACKGROUND_DATA * PBACKGROUND_DATA
static VOID SetWallpaper(PBACKGROUND_DATA pData)
static VOID AddListViewItems(HWND hwndDlg, PBACKGROUND_DATA pData)
struct _BACKGROUND_DATA BACKGROUND_DATA
HRESULT GdipGetEncoderClsid(PCWSTR MimeType, CLSID *pClsid)
@ PLACEMENT_VALUE_STRETCH
static UINT AddWallpapersFromDirectory(UINT uCounter, HWND hwndBackgroundList, BackgroundItem *backgroundItem, PBACKGROUND_DATA pData, LPCTSTR wallpaperFilename, LPCTSTR wallpaperDirectory)
static VOID DrawBackgroundPreview(LPDRAWITEMSTRUCT draw, PBACKGROUND_DATA pData)
static BOOL CheckListViewFilenameExists(HWND hwndList, LPCTSTR tszFileName)
LPWSTR GdipGetSupportedFileExtensions(VOID)
INT_PTR CALLBACK BackgroundPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
static VOID OnColorButton(HWND hwndDlg, PBACKGROUND_DATA pData)
static VOID ListViewItemChanged(HWND hwndDlg, PBACKGROUND_DATA pData, int itemIndex)
static VOID SetDesktopBackColor(HWND hwndDlg, PBACKGROUND_DATA pData)
static VOID OnCustomButton(HWND hwndDlg, PBACKGROUND_DATA pData)
#define RegCloseKey(hKey)
#define OFN_FILEMUSTEXIST
#define OFN_PATHMUSTEXIST
OPENFILENAMEA OPENFILENAME
static TAGREF LPCWSTR LPDWORD LPVOID lpBuffer
VOID InitDesktopSettings(PDESKTOP_DATA pData)
BOOL SaveDesktopSettings(PDESKTOP_DATA pData)
INT_PTR CALLBACK DesktopPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
VOID SetDesktopSettings(PDESKTOP_DATA pData)
VOID DibFreeImage(PDIBITMAP lpBitmap)
PDIBITMAP DibLoadImage(LPTSTR lpFilename)
#define IDC_BACKGROUND_LIST
#define IDD_DESKTOP_GENERAL
#define IDC_BACKGROUND_PREVIEW
#define IDS_BACKGROUND_COMDLG_FILTER
#define IDC_DESKTOP_CUSTOM
#define IDS_DESKTOP_ITEMS
#define IDC_PLACEMENT_COMBO
#define IDC_BROWSE_BUTTON
HIMAGELIST WINAPI ImageList_Create(INT cx, INT cy, UINT flags, INT cInitial, INT cGrow)
#define INVALID_HANDLE_VALUE
#define HeapFree(x, y, z)
GpStatus WINGDIPAPI GdipGetImageRawFormat(GpImage *image, GUID *format)
GpStatus WINGDIPAPI GdipGetImageEncodersSize(UINT *numEncoders, UINT *size)
GpStatus WINGDIPAPI GdipGetImageDecodersSize(UINT *numDecoders, UINT *size)
GpStatus WINGDIPAPI GdipSaveImageToFile(GpImage *image, GDIPCONST WCHAR *filename, GDIPCONST CLSID *clsidEncoder, GDIPCONST EncoderParameters *encoderParams)
GpStatus WINGDIPAPI GdipDisposeImage(GpImage *image)
GpStatus WINGDIPAPI GdipLoadImageFromFile(GDIPCONST WCHAR *filename, GpImage **image)
GpStatus WINGDIPAPI GdipGetImageEncoders(UINT numEncoders, UINT size, ImageCodecInfo *encoders)
GpStatus WINGDIPAPI GdipGetImageDecoders(UINT numDecoders, UINT size, ImageCodecInfo *decoders)
BOOL WINAPI FindClose(HANDLE hFindFile)
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
HRESULT WINAPI SHGetFolderPathW(HWND hwndOwner, int nFolder, HANDLE hToken, DWORD dwFlags, LPWSTR pszPath)
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Status WINAPI GdiplusStartup(ULONG_PTR *token, const struct GdiplusStartupInput *input, struct GdiplusStartupOutput *output)
void WINAPI GdiplusShutdown(ULONG_PTR)
GLint GLint GLint GLint GLint x
GLint GLint GLint GLint GLint GLint y
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
GLuint GLsizei GLsizei * length
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat token
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
static float(__cdecl *square_half_float)(float x
struct _PSP * HPROPSHEETPAGE
INT WINAPI MulDiv(INT nNumber, INT nNumerator, INT nDenominator)
#define FILE_ATTRIBUTE_HIDDEN
#define REG_OPTION_NON_VOLATILE
#define PropSheet_Changed(d, w)
#define CreatePropertySheetPage
_Out_opt_ int _Out_opt_ int * cy
#define ListView_InsertItem(hwnd, pitem)
#define ListView_SetItemState(hwndLV, i, data, mask)
#define ListView_InsertColumn(hwnd, iCol, pcol)
#define ListView_SetImageList(hwnd, himl, iImageList)
#define ListView_GetImageList(hwnd, iImageList)
struct tagNMLISTVIEW * LPNMLISTVIEW
#define ImageList_AddIcon(himl, hicon)
#define ListView_FindItem(hwnd, iStart, plvfi)
#define IsEqualGUID(rguid1, rguid2)
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path, DWORD dwFileAttributes, SHFILEINFOW *psfi, UINT sizeofpsfi, UINT flags)
#define SHGFI_DISPLAYNAME
#define CSIDL_FLAG_CREATE
#define CSIDL_LOCAL_APPDATA
#define PathRemoveExtension
STRSAFEAPI StringCbCatW(STRSAFE_LPWSTR pszDest, size_t cbDest, STRSAFE_LPCWSTR pszSrc)
TCHAR szFilename[MAX_PATH]
BOOL bClrBackgroundChanged
COLORREF custom_colors[16]
PDIBITMAP pWallpaperBitmap
BackgroundItem backgroundItems[MAX_BACKGROUNDS]
CHAR szDisplayName[MAX_PATH]
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
BOOL WINAPI GdiTransparentBlt(HDC hdcDst, int xDst, int yDst, int wDst, int hDst, HDC hdcSrc, int xSrc, int ySrc, int wSrc, int hSrc, UINT crTransparent)
#define success(from, fromstr, to, tostr)
#define GetWindowsDirectory
#define ExpandEnvironmentStrings
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)
HBRUSH WINAPI CreateSolidBrush(_In_ COLORREF)
BOOL WINAPI DeleteDC(_In_ HDC)
int WINAPI SetStretchBltMode(_In_ HDC, _In_ int)
int WINAPI StretchDIBits(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int, _In_ int, _In_ int, _In_ int, _In_ int, _In_opt_ const VOID *, _In_ const BITMAPINFO *, _In_ UINT, _In_ DWORD)
#define HKEY_LOCAL_MACHINE
#define HKEY_CURRENT_USER
struct tagDRAWITEMSTRUCT * LPDRAWITEMSTRUCT
#define SPI_SETDESKWALLPAPER
BOOL WINAPI SetSysColors(_In_ int cElements, _In_reads_(cElements) CONST INT *lpaElements, _In_reads_(cElements) CONST COLORREF *lpaRgbValues)
HBRUSH WINAPI GetSysColorBrush(_In_ int)
HANDLE WINAPI LoadImageW(_In_opt_ HINSTANCE hInst, _In_ LPCWSTR name, _In_ UINT type, _In_ int cx, _In_ int cy, _In_ UINT fuLoad)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define SPIF_UPDATEINIFILE
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
struct tagNMHDR * LPNMHDR
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
HWND WINAPI GetParent(_In_ HWND)
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
#define MAKEINTRESOURCEW(i)
#define SystemParametersInfo
#define SendDlgItemMessage
int WINAPI GetSystemMetrics(_In_ int)