Board index » delphi » How to load a bitmap from a system DLL

How to load a bitmap from a system DLL

how to load bitmap nr 120 from
C:\WINDOWS\SYSTEM\COMCTL32.DLL'

Var B:Tbitmap;

Begin
  B:=TBitmap.create;
  B.Handle:=??????????????????
End;

Does anyone ????

 

Re:How to load a bitmap from a system DLL


Quote
>how to load bitmap nr 120 from
>C:\WINDOWS\SYSTEM\COMCTL32.DLL'
>Var B:Tbitmap;
>Begin
>  B:=TBitmap.create;
>  B.Handle:=??????????????????
>End;
>Does anyone ????

 if (B <> nil) then B.Handle := LoadBitmap(HInstance, 'BMP_NAME')
to load the bitmap by name
Could also try
LoadBitmap(HInstance, PChar(BMP_ID))
to load the bitmap by resource id

Assuming that you've got you're TBitmap.Create in the constructor, or
OnCreate, don't forget to dispose of it (B.Free) when leaving ...

Best of luck...

Other Threads