解决vclskin可能存在的bug

该bug尤其在使用了FastReport预览,退出程序时可能出现。
bug表现为退出时弹出地址错误: Access violation at address 00000000. Read of address 00000000
vclskin版本:4.93.11.13

有疑问请与我联系coolslob@163.com

解决方法:将WinSkinForm.pas单元中,如下代码的第26行注释。
  1. procedure TWinSkinForm.GetIcon(var bmp:Tbitmap);
  2. var
  3.   SmallIcon: HIcon;
  4.   cx, cy,i: Integer;
  5.   sd:Tskindata;
  6. begin
  7.       cx := GetSystemMetrics(SM_CXSMICON);
  8.       cy := GetSystemMetrics(SM_CYSMICON);
  9. //      bmp.Assign(nil);
  10. //      bmp.canvas.brush.color:=clFuchsia;
  11.       bmp.width:=cx;bmp.height:=cy;
  12.       bmp.PixelFormat := pf16bit; 
  13.       bmp.Canvas.Brush.color:=clFuchsia;
  14.       bmp.canvas.fillrect(rect(0,0,cx,cy));
  15.       iconx:=cx;
  16.       // First try a small icon, then a big icon
  17.       DefIcon := SendMessage(hwnd, WM_GETICON, ICON_SMALL, 0);
  18.       if DefIcon = 0 then
  19.         DefIcon := SendMessage(hwnd, WM_GETICON, ICON_BIG, 0);
  20.       if DefIcon <> 0 then begin
  21.         SmallIcon := CopyImage(DefIcon, IMAGE_ICON, cx, cy, LR_COPYFROMRESOURCE);
  22.         DrawIconEx(bmp.Canvas.Handle, 00, SmallIcon,
  23.             cx, cy, 00, DI_MASK or DI_IMAGE );//DI_NORMAL);
  24.         DestroyIcon(SmallIcon);
  25.       //end else if not fsd.sysicon.empty then  begin //otherwise no icon found
  26.          //cause DLL exception
  27.          //bmp.assign(fsd.sysicon) ;
  28.          //bmp.PixelFormat := pf24bit;
  29.          //copybmp(sd.SysIcon,bmp);
  30.       end else begin
  31.          for i:= 0 to skinmanager.dlist.count-1 do begin
  32.              sd:= Tskindata(skinmanager.dlist.items[i]);
  33.              if sd.skinformtype=sfMainform then begin
  34.                 if not sd.sysicon.empty then
  35.                    //copybmp(sd.SysIcon,bmp);
  36.                    //bmp.assign(sd.sysicon) ;
  37.              end;
  38.          end;
  39.       end;
  40. end;

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值