summaryrefslogtreecommitdiff
path: root/src/w32fns.c
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2006-12-16 14:38:44 +0000
committerEli Zaretskii <eliz@gnu.org>2006-12-16 14:38:44 +0000
commita01763cbe790cf9834e609e89e0826935e36d0b8 (patch)
treeaee8838eb38c599c4c194749ad0b320758e74d7b /src/w32fns.c
parent651f81720c907f3ae904a58957368d8f70f6748e (diff)
downloademacs-a01763cbe790cf9834e609e89e0826935e36d0b8.tar.gz
(w32-window-exists-p): New function.
(syms_of_w32fns): Defsubr it.
Diffstat (limited to 'src/w32fns.c')
-rw-r--r--src/w32fns.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/w32fns.c b/src/w32fns.c
index 96fa9375ee8..34cfb0a2882 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -8349,6 +8349,30 @@ is set to off if the low bit of NEW-STATE is zero, otherwise on. */)
}
return Qnil;
}
+
+DEFUN ("w32-window-exists-p", Fw32_window_exists_p, Sw32_window_exists_p,
+ 2, 2, 0,
+ doc: /* Return non-nil if a window exists with the specified CLASS and NAME.
+
+This is a direct interface to the Windows API FindWindow function. */)
+ (class, name)
+Lisp_Object class, name;
+{
+ HWND hnd;
+
+ if (!NILP (class))
+ CHECK_STRING (class);
+ if (!NILP (name))
+ CHECK_STRING (name);
+
+ hnd = FindWindow (STRINGP (class) ? ((LPCTSTR) SDATA (class)) : NULL,
+ STRINGP (name) ? ((LPCTSTR) SDATA (name)) : NULL);
+ if (!hnd)
+ return Qnil;
+ return Qt;
+}
+
+
DEFUN ("file-system-info", Ffile_system_info, Sfile_system_info, 1, 1, 0,
doc: /* Return storage information about the file system FILENAME is on.
@@ -8915,6 +8939,7 @@ versions of Windows) characters. */);
staticpro (&Qw32_charset_unicode);
Qw32_charset_unicode = intern ("w32-charset-unicode");
+ }
#endif
#if 0 /* TODO: Port to W32 */
@@ -8959,6 +8984,7 @@ versions of Windows) characters. */);
defsubr (&Sw32_registered_hot_keys);
defsubr (&Sw32_reconstruct_hot_key);
defsubr (&Sw32_toggle_lock_key);
+ defsubr (&Sw32_window_exists_p);
defsubr (&Sw32_find_bdf_fonts);
defsubr (&Sfile_system_info);