Windows 10 Close, Minimize and Maximize buttons

前端 未结 2 1952
闹比i
闹比i 2021-02-09 12:08

to paint themed button I use this code:

var
  h: HTHEME;
begin
  if UseThemes then begin
    SetWindowTheme(Handle, \'explorer\', nil);
    h := OpenThemeData(Ha         


        
2条回答
  •  一向
    一向 (楼主)
    2021-02-09 12:37

    Workable solution to get bitmaps from theme:

    var
      h: HTHEME;
      Rect: TRect;
      BufSize: Cardinal;    
    
    h := OpenThemeData(Handle, 'DWMWINDOW');
    if h <> 0 then
    try
      GetThemeRect(h, WP_MINCAPTION, MNCS_ACTIVE, TMT_ATLASRECT, Rect);
      ...
      GetThemeStream(...);
    finally
      CloseThemeData(h);
    end;
    

    And how to use GetThemeStream described here: GetThemeStream usage, many thanks to Andreas Verhoeven, author of the program Vista Style Builder

提交回复
热议问题