1
2 {
3 The Start button does not autosize with the text length.
4 This means the button only makes room for a maximum of 5 letters.
5 It only works with Windows Xp
6 }
7
8 unit Unit1;
9
10 interface
11
12 uses
13 Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
14 StdCtrls;
15
16 type
17 TForm1 = class(TForm)
18 Button2: TButton;
19 Edit1: TEdit;
20 procedure Button2Click(Sender: TObject);
21 private
22 { private declarations }
23 public
24 { public declarations }
25 end;
26
27 var
28 Form1: TForm1;
29
30 implementation
31
32 {$R *.DFM}
33
34 procedure TForm1.Button2Click(Sender: TObject);
35 begin
36 //Hide The StartButton
37 ShowWindow(FindWindowEx(FindWindow('Shell_TrayWnd',
38 nil), 0, 'Button', nil),SW_Hide);
39 //Rename The Startbutton ...
40 SetWindowText(FindWindowEx(FindWindow('Shell_TrayWnd',
41 nil), 0, 'Button', nil),pchar(Edit1.text));
42 //Show The StartButton
43 ShowWindow(FindWindowEx(FindWindow('Shell_TrayWnd',
44 nil), 0, 'Button', nil),SW_NORMAL);
45 end;
46
47 end.
|