diff options
Diffstat (limited to 'src/w32term.c')
| -rw-r--r-- | src/w32term.c | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/src/w32term.c b/src/w32term.c index 5d14d758f74..f0d5dc507ac 100644 --- a/src/w32term.c +++ b/src/w32term.c | |||
| @@ -5418,16 +5418,25 @@ x_bitmap_icon (f, icon) | |||
| 5418 | struct frame *f; | 5418 | struct frame *f; |
| 5419 | Lisp_Object icon; | 5419 | Lisp_Object icon; |
| 5420 | { | 5420 | { |
| 5421 | HANDLE hicon; | 5421 | HANDLE main_icon; |
| 5422 | HANDLE small_icon = NULL; | ||
| 5422 | 5423 | ||
| 5423 | if (FRAME_W32_WINDOW (f) == 0) | 5424 | if (FRAME_W32_WINDOW (f) == 0) |
| 5424 | return 1; | 5425 | return 1; |
| 5425 | 5426 | ||
| 5426 | if (NILP (icon)) | 5427 | if (NILP (icon)) |
| 5427 | hicon = LoadIcon (hinst, EMACS_CLASS); | 5428 | main_icon = LoadIcon (hinst, EMACS_CLASS); |
| 5428 | else if (STRINGP (icon)) | 5429 | else if (STRINGP (icon)) |
| 5429 | hicon = LoadImage (NULL, (LPCTSTR) SDATA (icon), IMAGE_ICON, 0, 0, | 5430 | { |
| 5430 | LR_DEFAULTSIZE | LR_LOADFROMFILE); | 5431 | /* Load the main icon from the named file. */ |
| 5432 | main_icon = LoadImage (NULL, (LPCTSTR) SDATA (icon), IMAGE_ICON, 0, 0, | ||
| 5433 | LR_DEFAULTSIZE | LR_LOADFROMFILE); | ||
| 5434 | /* Try to load a small icon to go with it. */ | ||
| 5435 | small_icon = LoadImage (NULL, (LPCSTR) SDATA (icon), IMAGE_ICON, | ||
| 5436 | GetSystemMetrics (SM_CXSMICON), | ||
| 5437 | GetSystemMetrics (SM_CYSMICON), | ||
| 5438 | LR_LOADFROMFILE); | ||
| 5439 | } | ||
| 5431 | else if (SYMBOLP (icon)) | 5440 | else if (SYMBOLP (icon)) |
| 5432 | { | 5441 | { |
| 5433 | LPCTSTR name; | 5442 | LPCTSTR name; |
| @@ -5447,16 +5456,21 @@ x_bitmap_icon (f, icon) | |||
| 5447 | else | 5456 | else |
| 5448 | return 1; | 5457 | return 1; |
| 5449 | 5458 | ||
| 5450 | hicon = LoadIcon (NULL, name); | 5459 | main_icon = LoadIcon (NULL, name); |
| 5451 | } | 5460 | } |
| 5452 | else | 5461 | else |
| 5453 | return 1; | 5462 | return 1; |
| 5454 | 5463 | ||
| 5455 | if (hicon == NULL) | 5464 | if (main_icon == NULL) |
| 5456 | return 1; | 5465 | return 1; |
| 5457 | 5466 | ||
| 5458 | PostMessage (FRAME_W32_WINDOW (f), WM_SETICON, (WPARAM) ICON_BIG, | 5467 | PostMessage (FRAME_W32_WINDOW (f), WM_SETICON, (WPARAM) ICON_BIG, |
| 5459 | (LPARAM) hicon); | 5468 | (LPARAM) main_icon); |
| 5469 | |||
| 5470 | /* If there is a small icon that goes with it, set that too. */ | ||
| 5471 | if (small_icon) | ||
| 5472 | PostMessage (FRAME_W32_WINDOW (f), WM_SETICON, (WPARAM) ICON_SMALL, | ||
| 5473 | (LPARAM) small_icon); | ||
| 5460 | 5474 | ||
| 5461 | return 0; | 5475 | return 0; |
| 5462 | } | 5476 | } |