Mega Code Archive

 
Categories / Delphi / System
 

How to rename the startbutton[xp only]

{ The Start button does not autosize with the text length. This means the button only makes room for a maximum of 5 letters. It only works with Windows Xp } unit Unit1; interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Button2: TButton; Edit1: TEdit; procedure Button2Click(Sender: TObject); private { private declarations } public { public declarations } end; var Form1: TForm1; implementation {$R *.DFM} procedure TForm1.Button2Click(Sender: TObject); begin //Hide The StartButton ShowWindow(FindWindowEx(FindWindow('Shell_TrayWnd', nil), 0, 'Button', nil),SW_Hide); //Rename The Startbutton ... SetWindowText(FindWindowEx(FindWindow('Shell_TrayWnd', nil), 0, 'Button', nil),pchar(Edit1.text)); //Show The StartButton ShowWindow(FindWindowEx(FindWindow('Shell_TrayWnd', nil), 0, 'Button', nil),SW_NORMAL); end; end.