summaryrefslogtreecommitdiff
path: root/src/w32fns.c
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2022-09-15 09:12:13 +0300
committerEli Zaretskii <eliz@gnu.org>2022-09-15 09:12:13 +0300
commit5fe9a1a85ae6d54196031157a735352f6ab655ff (patch)
treea0a2c4b1e004b1b4d9eb318ed9d1e8fbb2dd534a /src/w32fns.c
parent41551ccbf63df589ed50129e92fa8dfe457617d0 (diff)
downloademacs-5fe9a1a85ae6d54196031157a735352f6ab655ff.tar.gz
; Fix doc string of 'loaddefs-generate'
* lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate): Doc fix. (Bug#57815)
Diffstat (limited to 'src/w32fns.c')
-rw-r--r--src/w32fns.c45
1 files changed, 45 insertions, 0 deletions
diff --git a/src/w32fns.c b/src/w32fns.c
index 745458d0a03..57296bd4e07 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -10447,6 +10447,51 @@ w32_get_resource (const char *key, const char *name, LPDWORD lpdwtype)
return (NULL);
}
+#ifdef WINDOWSNT
+
+/***********************************************************************
+ Wallpaper
+ ***********************************************************************/
+
+#if 0
+
+typedef BOOL (WINAPI * SystemParametersInfoW_Proc) (UINT,UINT,PVOID,UINT);
+static SystemParametersInfoW_Proc system_parameters_info_w_fn;
+
+DEFUN ("w32-set-wallpaper", Fw32_set_wallpaper, Sw32_set_wallpaper, 1, 1, 0,
+ doc: /* Set the desktop wallpaper image to IMAGE-FILE. */)
+ (Lisp_Object image_file)
+{
+ Lisp_Object encoded = ENCODE_FILE (Fexpand_file_name (image_file, Qnil));
+ char *fname = SSDATA (encoded);
+
+ if (w32_unicode_filenames)
+ {
+ }
+ else
+ {
+ char fname_a[MAX_PATH];
+
+ if (filename_to_ansi (fname, fname_a) != 0)
+ error ("Wallpaper file %s does not exist or cannot be accessed", fname);
+
+ BOOL result = SystemParametersInfoA (SPI_SETDESKWALLPAPER, 0, fname_a,
+ SPIF_SENDCHANGE);
+ if (!result)
+ {
+ DWORD err = GetLastError ();
+ if (err)
+ error ("Could not set wallpaper: %s", w32_strerror (err));
+ else
+ error ("Could not set wallpaper");
+ }
+ }
+ return Qnil;
+}
+#endif
+
+#endif
+
/***********************************************************************
Initialization
***********************************************************************/