freetype-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Git][freetype/freetype-demos][master] [graph/win32] Simplify icon setti


From: Alexei Podtelezhnikov (@apodtele)
Subject: [Git][freetype/freetype-demos][master] [graph/win32] Simplify icon setting further.
Date: Mon, 23 May 2022 20:26:28 +0000

Alexei Podtelezhnikov pushed to branch master at FreeType / FreeType Demo Programs

Commits:

1 changed file:

Changes:

  • graph/win32/grwin32.c
    ... ... @@ -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
     
    


  • reply via email to

    [Prev in Thread] Current Thread [Next in Thread]