aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJason Rumney <[email protected]>2005-09-11 20:34:04 +0000
committerJason Rumney <[email protected]>2005-09-11 20:34:04 +0000
commit945a75f8b050d91308a7ee4d7e24d2cb5dce0f28 (patch)
tree6e42657152a540da4e5cbb35cc21f150b8c65893 /src
parent7525e76fc5f821eaccaaa7db0af3e5a036424951 (diff)
2005-09-11 Chris Prince <[email protected]> (tiny change)
* w32term.c (x_bitmap_icon): Load small icons too.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog4
-rw-r--r--src/w32term.c28
2 files changed, 25 insertions, 7 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index e3fb1e07ab..13f8c409cd 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,7 @@
+2005-09-11 Chris Prince <[email protected]> (tiny change)
+
+ * w32term.c (x_bitmap_icon): Load small icons too.
+
2005-09-10 Romain Francoise <[email protected]>
* buffer.c (init_buffer): Grow buffer to add directory separator
diff --git a/src/w32term.c b/src/w32term.c
index 8f52b5178d..8a28ac136b 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -5267,16 +5267,25 @@ x_bitmap_icon (f, icon)
struct frame *f;
Lisp_Object icon;
{
- HANDLE hicon;
+ HANDLE main_icon;
+ HANDLE small_icon = NULL;
if (FRAME_W32_WINDOW (f) == 0)
return 1;
if (NILP (icon))
- hicon = LoadIcon (hinst, EMACS_CLASS);
+ main_icon = LoadIcon (hinst, EMACS_CLASS);
else if (STRINGP (icon))
- hicon = LoadImage (NULL, (LPCTSTR) SDATA (icon), IMAGE_ICON, 0, 0,
- LR_DEFAULTSIZE | LR_LOADFROMFILE);
+ {
+ /* Load the main icon from the named file. */
+ main_icon = LoadImage (NULL, (LPCTSTR) SDATA (icon), IMAGE_ICON, 0, 0,
+ LR_DEFAULTSIZE | LR_LOADFROMFILE);
+ /* Try to load a small icon to go with it. */
+ small_icon = LoadImage (NULL, (LPCSTR) SDATA (icon), IMAGE_ICON,
+ GetSystemMetrics (SM_CXSMICON),
+ GetSystemMetrics (SM_CYSMICON),
+ LR_LOADFROMFILE);
+ }
else if (SYMBOLP (icon))
{
LPCTSTR name;
@@ -5296,16 +5305,21 @@ x_bitmap_icon (f, icon)
else
return 1;
- hicon = LoadIcon (NULL, name);
+ main_icon = LoadIcon (NULL, name);
}
else
return 1;
- if (hicon == NULL)
+ if (main_icon == NULL)
return 1;
PostMessage (FRAME_W32_WINDOW (f), WM_SETICON, (WPARAM) ICON_BIG,
- (LPARAM) hicon);
+ (LPARAM) main_icon);
+
+ /* If there is a small icon that goes with it, set that too. */
+ if (small_icon)
+ PostMessage (FRAME_W32_WINDOW (f), WM_SETICON, (WPARAM) ICON_SMALL,
+ (LPARAM) small_icon);
return 0;
}