16 #define MAX_BACKGROUNDS 100 44 #define MONITOR_LEFT 20 46 #define MONITOR_RIGHT 140 47 #define MONITOR_BOTTOM 92 49 #define MONITOR_WIDTH (MONITOR_RIGHT-MONITOR_LEFT) 50 #define MONITOR_HEIGHT (MONITOR_BOTTOM-MONITOR_TOP) 115 if (!
_wcsicmp(codecInfo[
i].MimeType, MimeType))
117 *pClsid = codecInfo[
i].
Clsid;
240 backgroundItem = &
pData->backgroundItems[
pData->listViewItemCount];
266 listItem.iImage = sfi.
iIcon;
267 listItem.iItem =
pData->listViewItemCount;
268 listItem.lParam =
pData->listViewItemCount;
272 pData->listViewItemCount++;
308 HWND hwndBackgroundList;
323 #define IDI_SHELL_NO 200 338 backgroundItem = &
pData->backgroundItems[
pData->listViewItemCount];
350 listItem.iItem =
pData->listViewItemCount;
351 listItem.lParam =
pData->listViewItemCount;
356 pData->listViewItemCount,
360 pData->listViewItemCount++;
380 hr =
StringCbCopy(wallpaperFilename,
sizeof(wallpaperFilename), originalWallpaper);
410 backgroundItem = &
pData->backgroundItems[
pData->listViewItemCount];
434 listItem.iImage = sfi.
iIcon;
435 listItem.iItem =
pData->listViewItemCount;
436 listItem.lParam =
pData->listViewItemCount;
440 pData->listViewItemCount,
444 pData->listViewItemCount++;
537 if (
_ttoi(szBuffer) == 1)
573 cc.hwndOwner = hwndDlg;
576 cc.lpCustColors =
pData->custom_colors;
621 lvfi.psz = tszFileName;
637 TCHAR fileTitle[256];
644 HWND hwndBackgroundList;
672 buffersize = (
_tcslen(extensions) * 2 + 6) *
sizeof(
TCHAR) +
sizeof(filterdesc);
681 sizeRemain = buffersize;
692 sizeRemain -=
sizeof(*c);
733 backgroundItem = &
pData->backgroundItems[
pData->listViewItemCount];
751 listItem.iImage = sfi.
iIcon;
752 listItem.iItem =
pData->listViewItemCount;
753 listItem.lParam =
pData->listViewItemCount;
757 pData->listViewItemCount,
762 pData->listViewItemCount++;
772 pData->backgroundSelection = itemIndex;
773 backgroundItem = &
pData->backgroundItems[
pData->backgroundSelection];
810 int fitFillScaleNum, fitFillScaleDen;
811 int fitFillWidth, fitFillHeight;
827 if (
pData->backgroundItems[
pData->backgroundSelection].bWallpaper ==
FALSE)
840 scaledWidth = (
int)(
pData->pWallpaperBitmap->width / scaleX);
841 scaledHeight = (
int)(
pData->pWallpaperBitmap->height / scaleY);
847 switch (
pData->placementSelection)
855 if (posX < 0) { desX = -posX / 2; posX = 0; }
856 if (posY < 0) { desY = -posY / 2; posY = 0; }
871 pData->pWallpaperBitmap->width - (
int)(desX * scaleX),
872 pData->pWallpaperBitmap->height - (
int)(desY * scaleY),
873 pData->pWallpaperBitmap->bits,
874 pData->pWallpaperBitmap->info,
887 pData->pWallpaperBitmap->width,
888 pData->pWallpaperBitmap->height,
889 pData->pWallpaperBitmap->bits,
890 pData->pWallpaperBitmap->info,
918 pData->pWallpaperBitmap->width * posX / scaledWidth,
919 pData->pWallpaperBitmap->height * posY / scaledHeight,
920 pData->pWallpaperBitmap->bits,
921 pData->pWallpaperBitmap->info,
934 fitFillScaleDen = scaledWidth;
939 fitFillScaleDen = scaledHeight;
942 fitFillWidth =
MulDiv(scaledWidth, fitFillScaleNum, fitFillScaleDen);
943 fitFillHeight =
MulDiv(scaledHeight, fitFillScaleNum, fitFillScaleDen);
955 pData->pWallpaperBitmap->width,
956 pData->pWallpaperBitmap->height,
957 pData->pWallpaperBitmap->bits,
958 pData->pWallpaperBitmap->info,
967 fitFillScaleDen = scaledWidth;
972 fitFillScaleDen = scaledHeight;
975 fitFillWidth =
MulDiv(scaledWidth, fitFillScaleNum, fitFillScaleDen);
976 fitFillHeight =
MulDiv(scaledHeight, fitFillScaleNum, fitFillScaleDen);
978 desX = (((fitFillWidth -
MONITOR_WIDTH) *
pData->pWallpaperBitmap->width) / (2 * fitFillWidth));
979 desY = (((fitFillHeight -
MONITOR_HEIGHT) *
pData->pWallpaperBitmap->height) / (2 * fitFillHeight));
990 pData->pWallpaperBitmap->bits,
991 pData->pWallpaperBitmap->info,
1069 if (
pData->backgroundItems[
pData->backgroundSelection].bWallpaper !=
FALSE)
1107 TEXT(
"ConvertedWallpaper"),
1117 TEXT(
"OriginalWallpaper"),
1243 if (
pData->bWallpaperChanged)
1245 if (
pData->bClrBackgroundChanged)
#define IDC_BACKGROUND_PREVIEW
#define OFN_FILEMUSTEXIST
#define IDC_BROWSE_BUTTON
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)
GpStatus WINGDIPAPI GdipGetImageEncoders(UINT numEncoders, UINT size, ImageCodecInfo *encoders)
static VOID SetWallpaper(PBACKGROUND_DATA pData)
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
VOID DibFreeImage(PDIBITMAP lpBitmap)
GpStatus WINGDIPAPI GdipLoadImageFromFile(GDIPCONST WCHAR *filename, GpImage **image)
struct tagDRAWITEMSTRUCT * LPDRAWITEMSTRUCT
#define SPI_SETDESKWALLPAPER
#define HKEY_CURRENT_USER
struct _BACKGROUND_DATA * PBACKGROUND_DATA
#define ExpandEnvironmentStrings
struct _BACKGROUND_DATA BACKGROUND_DATA
#define SystemParametersInfo
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
#define INVALID_HANDLE_VALUE
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
static UINT AddWallpapersFromDirectory(UINT uCounter, HWND hwndBackgroundList, BackgroundItem *backgroundItem, PBACKGROUND_DATA pData, LPCTSTR wallpaperFilename, LPCTSTR wallpaperDirectory)
GLint GLint GLint GLint GLint x
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
#define PathRemoveExtension
#define SendDlgItemMessage
#define ListView_InsertItem(hwnd, pitem)
HRESULT GdipGetEncoderClsid(PCWSTR MimeType, CLSID *pClsid)
INT WINAPI MulDiv(INT nNumber, INT nNumerator, INT nDenominator)
GpStatus WINGDIPAPI GdipSaveImageToFile(GpImage *image, GDIPCONST WCHAR *filename, GDIPCONST CLSID *clsidEncoder, GDIPCONST EncoderParameters *encoderParams)
COLORREF custom_colors[16]
STRSAFEAPI StringCbCatW(STRSAFE_LPWSTR pszDest, size_t cbDest, STRSAFE_LPCWSTR pszSrc)
struct tagNMHDR * LPNMHDR
GpStatus WINGDIPAPI GdipGetImageDecodersSize(UINT *numDecoders, UINT *size)
static VOID OnColorButton(HWND hwndDlg, PBACKGROUND_DATA pData)
#define ListView_InsertColumn(hwnd, iCol, pcol)
LONG WINAPI RegCloseKey(HKEY hKey)
HIMAGELIST WINAPI ImageList_Create(INT cx, INT cy, UINT flags, INT cInitial, INT cGrow)
#define ListView_GetImageList(hwnd, iImageList)
static BOOL CheckListViewFilenameExists(HWND hwndList, LPCTSTR tszFileName)
#define ListView_SetItemState(hwndLV, i, data, mask)
HANDLE WINAPI LoadImageW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _In_ UINT, _In_ int, _In_ int, _In_ UINT)
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
GLenum GLuint GLenum GLsizei length
static TAGREF LPCWSTR LPDWORD LPVOID lpBuffer
_Out_opt_ int _Out_opt_ int * cy
size_t __cdecl _tcslen(const _TCHAR *str)
#define ListView_SetImageList(hwnd, himl, iImageList)
GpStatus WINGDIPAPI GdipGetImageRawFormat(GpImage *image, GUID *format)
GpStatus WINGDIPAPI GdipGetImageDecoders(UINT numDecoders, UINT size, ImageCodecInfo *decoders)
#define SHGFI_DISPLAYNAME
OPENFILENAMEA OPENFILENAME
#define OFN_PATHMUSTEXIST
#define REG_OPTION_NON_VOLATILE
CHAR szDisplayName[MAX_PATH]
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
PDIBITMAP DibLoadImage(LPTSTR lpFilename)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path, DWORD dwFileAttributes, SHFILEINFOW *psfi, UINT sizeofpsfi, UINT flags)
#define PropSheet_Changed(d, w)
LPWSTR GdipGetSupportedFileExtensions(VOID)
#define CSIDL_LOCAL_APPDATA
BOOL bClrBackgroundChanged
void WINAPI GdiplusShutdown(ULONG_PTR)
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
#define IDC_BACKGROUND_LIST
Status WINAPI GdiplusStartup(ULONG_PTR *token, const struct GdiplusStartupInput *input, struct GdiplusStartupOutput *output)
int WINAPI GetSystemMetrics(_In_ int)
BackgroundItem backgroundItems[MAX_BACKGROUNDS]
#define success(from, fromstr, to, tostr)
INT WINAPI ImageList_AddIcon(HIMAGELIST himl, HICON hIcon)
#define IDS_BACKGROUND_COMDLG_FILTER
static VOID ListViewItemChanged(HWND hwndDlg, PBACKGROUND_DATA pData, int itemIndex)
BOOL WINAPI SetSysColors(_In_ int cElements, _In_reads_(cElements) CONST INT *lpaElements, _In_reads_(cElements) CONST COLORREF *lpaRgbValues)
GpStatus WINGDIPAPI GdipGetImageEncodersSize(UINT *numEncoders, UINT *size)
GpStatus WINGDIPAPI GdipDisposeImage(GpImage *image)
static VOID SetDesktopBackColor(HWND hwndDlg, PBACKGROUND_DATA pData)
int WINAPI SetStretchBltMode(_In_ HDC, _In_ int)
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
HWND WINAPI GetParent(_In_ HWND)
#define SPIF_UPDATEINIFILE
PDIBITMAP pWallpaperBitmap
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
BOOL WINAPI DeleteDC(_In_ HDC)
static float(__cdecl *square_half_float)(float x
struct tagNMLISTVIEW * LPNMLISTVIEW
static VOID InitBackgroundDialog(HWND hwndDlg, PBACKGROUND_DATA pData)
static VOID OnBrowseButton(HWND hwndDlg, PBACKGROUND_DATA pData)
int CDECL _ttoi(const _TCHAR *str)
static VOID DrawBackgroundPreview(LPDRAWITEMSTRUCT draw, PBACKGROUND_DATA pData)
#define FILE_ATTRIBUTE_HIDDEN
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
HBRUSH WINAPI CreateSolidBrush(_In_ COLORREF)
#define CSIDL_FLAG_CREATE
GLint GLint GLint GLint GLint GLint y
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
TCHAR szFilename[MAX_PATH]
#define ListView_FindItem(hwnd, iStart, plvfi)
HRESULT WINAPI SHGetFolderPathW(HWND hwndOwner, int nFolder, HANDLE hToken, DWORD dwFlags, LPWSTR pszPath)
_TCHAR * _tcsrchr(const _TCHAR *s, _XINT c)
#define IDC_PLACEMENT_COMBO
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
#define MAKEINTRESOURCEW(i)
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)
HBRUSH WINAPI GetSysColorBrush(_In_ int)
#define GetWindowsDirectory
static SERVICE_STATUS status
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
#define HeapFree(x, y, z)
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
static VOID AddListViewItems(HWND hwndDlg, PBACKGROUND_DATA 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)
INT_PTR CALLBACK BackgroundPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
#define HKEY_LOCAL_MACHINE
BOOL WINAPI FindClose(HANDLE hFindFile)