Registriert seit: 8. Mai 2005
Ort: Sondershausen
4.274 Beiträge
Delphi 6 Personal
|
AW: Button mit Glyph: Alternativen zum BitBtn
4. Feb 2011, 16:34
Per SedMessage:
Delphi-Quellcode:
function SetIconToCaption(h_Wnd: HWND; IconID: Integer): Bool;
var
aIcon: HICON;
begin
Result := FALSE;
aIcon := LoadImage(hInstance, MAKEINTRESOURCE(IconID), IMAGE_ICON, 16, 16, LR_DEFAULTSIZE);
if aIcon > 0 then
Result := SendMessage(h_Wnd, WM_SETICON, ICON_SMALL, LPARAM(aIcon)) <> 0;
DeleteObject(aIcon);
end;
procedure TForm1.XYZ;
begin
SetIconToCaption(Button1.Handle, 1);
end;
|
|
Zitat
|