Mercurial > emacs
comparison src/w32term.c @ 65444:14dd537e7ba9
2005-09-11 Chris Prince <cprince@gmail.com> (tiny change)
* w32term.c (x_bitmap_icon): Load small icons too.
author | Jason Rumney <jasonr@gnu.org> |
---|---|
date | Sun, 11 Sep 2005 20:32:10 +0000 |
parents | a0d1312ede66 |
children | 41fc0bf568be 23f939241b7d 10fe5fadaf89 |
comparison
equal
deleted
inserted
replaced
65443:13257ea43dbf | 65444:14dd537e7ba9 |
---|---|
5265 int | 5265 int |
5266 x_bitmap_icon (f, icon) | 5266 x_bitmap_icon (f, icon) |
5267 struct frame *f; | 5267 struct frame *f; |
5268 Lisp_Object icon; | 5268 Lisp_Object icon; |
5269 { | 5269 { |
5270 HANDLE hicon; | 5270 HANDLE main_icon; |
5271 HANDLE small_icon = NULL; | |
5271 | 5272 |
5272 if (FRAME_W32_WINDOW (f) == 0) | 5273 if (FRAME_W32_WINDOW (f) == 0) |
5273 return 1; | 5274 return 1; |
5274 | 5275 |
5275 if (NILP (icon)) | 5276 if (NILP (icon)) |
5276 hicon = LoadIcon (hinst, EMACS_CLASS); | 5277 main_icon = LoadIcon (hinst, EMACS_CLASS); |
5277 else if (STRINGP (icon)) | 5278 else if (STRINGP (icon)) |
5278 hicon = LoadImage (NULL, (LPCTSTR) SDATA (icon), IMAGE_ICON, 0, 0, | 5279 { |
5279 LR_DEFAULTSIZE | LR_LOADFROMFILE); | 5280 /* Load the main icon from the named file. */ |
5281 main_icon = LoadImage (NULL, (LPCTSTR) SDATA (icon), IMAGE_ICON, 0, 0, | |
5282 LR_DEFAULTSIZE | LR_LOADFROMFILE); | |
5283 /* Try to load a small icon to go with it. */ | |
5284 small_icon = LoadImage (NULL, (LPCSTR) SDATA (icon), IMAGE_ICON, | |
5285 GetSystemMetrics (SM_CXSMICON), | |
5286 GetSystemMetrics (SM_CYSMICON), | |
5287 LR_LOADFROMFILE); | |
5288 } | |
5280 else if (SYMBOLP (icon)) | 5289 else if (SYMBOLP (icon)) |
5281 { | 5290 { |
5282 LPCTSTR name; | 5291 LPCTSTR name; |
5283 | 5292 |
5284 if (EQ (icon, intern ("application"))) | 5293 if (EQ (icon, intern ("application"))) |
5294 else if (EQ (icon, intern ("winlogo"))) | 5303 else if (EQ (icon, intern ("winlogo"))) |
5295 name = (LPCTSTR) IDI_WINLOGO; | 5304 name = (LPCTSTR) IDI_WINLOGO; |
5296 else | 5305 else |
5297 return 1; | 5306 return 1; |
5298 | 5307 |
5299 hicon = LoadIcon (NULL, name); | 5308 main_icon = LoadIcon (NULL, name); |
5300 } | 5309 } |
5301 else | 5310 else |
5302 return 1; | 5311 return 1; |
5303 | 5312 |
5304 if (hicon == NULL) | 5313 if (main_icon == NULL) |
5305 return 1; | 5314 return 1; |
5306 | 5315 |
5307 PostMessage (FRAME_W32_WINDOW (f), WM_SETICON, (WPARAM) ICON_BIG, | 5316 PostMessage (FRAME_W32_WINDOW (f), WM_SETICON, (WPARAM) ICON_BIG, |
5308 (LPARAM) hicon); | 5317 (LPARAM) main_icon); |
5318 | |
5319 /* If there is a small icon that goes with it, set that too. */ | |
5320 if (small_icon) | |
5321 PostMessage (FRAME_W32_WINDOW (f), WM_SETICON, (WPARAM) ICON_SMALL, | |
5322 (LPARAM) small_icon); | |
5309 | 5323 |
5310 return 0; | 5324 return 0; |
5311 } | 5325 } |
5312 | 5326 |
5313 | 5327 |