Dazza051197
asked on
Small Icons
I've seen Windows 95 show the icons as 18x18, how do I stretch my icons in Delphi 2 to this size ? They have to be icons because I'm extracting them from exe's, but I want them smaller on my buttons.
Darren
Darren
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Not that I'm going to interfear with BoRiS's excellent answer (Thanks), I have been looking for that API myself. Anyway, When you get the handle to an Imagelist, you can pass it to severel other API's (Try look up ImageList_GetIcon in Delphi help) It's not that difficult at all. I f you just know the index value, one more call should do it.
Afterwards do like:
Icon:= TIcon.Create;
Icon.Handle:= hICON;
..And that's it
Regards
Williams
Afterwards do like:
Icon:= TIcon.Create;
Icon.Handle:= hICON;
..And that's it
Regards
Williams
try this....
uses
..., ShellApi;
procedure TForm .........
var
SmallIco: TIcon;
shfi: TShFileInfo;
begin
SmallIco := TIcon.Create;
ZeroMemory(@shfi, SizeOf(shfi));
ShGetFileInfo('C:\MyFile.e xe', 0, shfi, SizeOf(shfi), SHGFI_SMALLICON);
SmallIco.Handle := shfi.hIcon;
... {rest of coding}
SmallIco.Free;
end;
got this from a good friend, maybe you know him...
uses
..., ShellApi;
procedure TForm .........
var
SmallIco: TIcon;
shfi: TShFileInfo;
begin
SmallIco := TIcon.Create;
ZeroMemory(@shfi, SizeOf(shfi));
ShGetFileInfo('C:\MyFile.e
SmallIco.Handle := shfi.hIcon;
... {rest of coding}
SmallIco.Free;
end;
got this from a good friend, maybe you know him...
Dazza
Please grade this answer
Thank You
BoRiS
Please grade this answer
Thank You
BoRiS
ASKER
Sorry for the delay, been tied up with other things.
Your answer works a treat, thanks.
Daz
Your answer works a treat, thanks.
Daz
ASKER
I'll increase to 300 points if you can provide a Delphi 2 example to return a small TIcon from a filename provided.
Daz