Alexei Podtelezhnikov pushed to branch master at FreeType / FreeType Demo Programs
Commits:
-
6bf509e1
by Alexei Podtelezhnikov at 2022-05-23T16:24:46-04:00
1 changed file:
Changes:
... | ... | @@ -247,11 +247,10 @@ static int |
247 | 247 | gr_win32_surface_set_icon( grWin32Surface* surface,
|
248 | 248 | grBitmap* icon )
|
249 | 249 | {
|
250 | - int s[] = { GetSystemMetrics( SM_CYSMICON ),
|
|
251 | - GetSystemMetrics( SM_CYICON ) };
|
|
252 | - WPARAM wParam;
|
|
253 | - ICONINFO ici = { TRUE };
|
|
254 | - HICON hIcon;
|
|
250 | + int s[] = { GetSystemMetrics( SM_CYSMICON ),
|
|
251 | + GetSystemMetrics( SM_CYICON ) };
|
|
252 | + WPARAM wParam;
|
|
253 | + HICON hIcon;
|
|
255 | 254 | |
256 | 255 | if ( !icon )
|
257 | 256 | return s[1];
|
... | ... | @@ -264,13 +263,8 @@ gr_win32_surface_set_icon( grWin32Surface* surface, |
264 | 263 | else
|
265 | 264 | return 0;
|
266 | 265 | |
267 | - ici.hbmMask = CreateBitmap( icon->width, icon->rows, 1, 1, NULL );
|
|
268 | - ici.hbmColor = CreateBitmap( icon->width, icon->rows, 1, 32, icon->buffer );
|
|
269 | - |
|
270 | - hIcon = CreateIconIndirect( &ici );
|
|
271 | - |
|
272 | - DeleteObject( ici.hbmMask );
|
|
273 | - DeleteObject( ici.hbmColor );
|
|
266 | + hIcon = CreateIcon( NULL, icon->width, icon->rows, 1, 32,
|
|
267 | + NULL, icon->buffer );
|
|
274 | 268 | |
275 | 269 | PostMessage( surface->window, WM_SETICON, wParam, (LPARAM)hIcon );
|
276 | 270 |