Alterar o ícone do botãoiniciar do Windows

Variveis globais do form:

var
Form1: TForm1;
Iniciar : hWnd;
OldBitmap : THandle;
NewImage : TPicture;

No Oncreate do Form:


procedure TForm1.FormCreate(Sender: TObject);
begin
  NewImage:=TPicture.create;
  NewImage.LoadFromFile('C:Delphi3ImagesDEFAULTOutOpen.BMP');
  Iniciar := FindWindowEx(FindWindow('Shell_TrayWnd',nil),0,'Button',nil);
  OldBitmap:=SendMessage(Iniciar,BM_SetImage,0,NewImage.Bitmap.Handle);
end;

No OnDestroy

procedure TForm1.FormDestroy(Sender: TObject);
begin
  SendMessage(Iniciar,BM_SetImage,0,OldBitmap);
  NewImage.Free;
end;    

Autor : desconhecido

Voltar