该bug尤其在使用了FastReport预览,退出程序时可能出现。
bug表现为退出时弹出地址错误:
Access violation at address 00000000. Read of address 00000000。
vclskin版本:4.93.11.13
有疑问请与我联系coolslob@163.com
解决方法:将WinSkinForm.pas单元中,如下代码的第26行注释。
- procedure TWinSkinForm.GetIcon(var bmp:Tbitmap);
- var
- SmallIcon: HIcon;
- cx, cy,i: Integer;
- sd:Tskindata;
- begin
- cx := GetSystemMetrics(SM_CXSMICON);
- cy := GetSystemMetrics(SM_CYSMICON);
- // bmp.Assign(nil);
- // bmp.canvas.brush.color:=clFuchsia;
- bmp.width:=cx;bmp.height:=cy;
- bmp.PixelFormat := pf16bit;
- bmp.Canvas.Brush.color:=clFuchsia;
- bmp.canvas.fillrect(rect(0,0,cx,cy));
- iconx:=cx;
- // First try a small icon, then a big icon
- DefIcon := SendMessage(hwnd, WM_GETICON, ICON_SMALL, 0);
- if DefIcon = 0 then
- DefIcon := SendMessage(hwnd, WM_GETICON, ICON_BIG, 0);
- if DefIcon <> 0 then begin
- SmallIcon := CopyImage(DefIcon, IMAGE_ICON, cx, cy, LR_COPYFROMRESOURCE);
- DrawIconEx(bmp.Canvas.Handle, 0, 0, SmallIcon,
- cx, cy, 0, 0, DI_MASK or DI_IMAGE );//DI_NORMAL);
- DestroyIcon(SmallIcon);
- //end else if not fsd.sysicon.empty then begin //otherwise no icon found
- //cause DLL exception
- //bmp.assign(fsd.sysicon) ;
- //bmp.PixelFormat := pf24bit;
- //copybmp(sd.SysIcon,bmp);
- end else begin
- for i:= 0 to skinmanager.dlist.count-1 do begin
- sd:= Tskindata(skinmanager.dlist.items[i]);
- if sd.skinformtype=sfMainform then begin
- if not sd.sysicon.empty then
- //copybmp(sd.SysIcon,bmp);
- //bmp.assign(sd.sysicon) ;
- end;
- end;
- end;
- end;