我想这个能符合你的要求把!不过可显示的字数有限制,没办法就那么大地方。<br><br>unit Unit2;<br><br>interface<br><br>uses<br> Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,<br> Dialogs, StdCtrls, ExtCtrls;<br><br>type<br> TForm1 = class(TForm)<br> Button1: TButton;<br> Panel1: TPanel;<br> Timer1: TTimer;<br> procedure Button1Click(Sender: TObject);<br> procedure Timer1Timer(Sender: TObject);<br> procedure FormCreate(Sender: TObject);<br> private<br> { Private declarations }<br> public<br> { Public declarations }<br> end;<br><br>var<br> Form1: TForm1;<br> t:SYSTEMTIME;<br><br>implementation<br><br>{$R *.dfm}<br><br>procedure TForm1.Button1Click(Sender: TObject);<br>var<br> th:hwnd;<br> r:trect;<br> dc:hdc;<br>begin<br> th:=FindWindowEx(FindWindowEx(FindWindow('Shell_TrayWnd',nil),0,'TrayNotifyWnd',nil),0,'TrayClockWClass',nil);<br> getwindowrect(th,r);<br> windows.setparent(panel1.Handle,th);<br> MoveWindow(panel1.Handle,0,0,r.Right-r.Left,r.Bottom-r.Top,true);<br>end;<br><br>procedure TForm1.Timer1Timer(Sender: TObject);<br>begin<br> getlocaltime(t);<br> panel1.Caption:='My '+inttostr(t.wHour)+':'+inttostr(t.wMinute);<br>// panel1.Hint:=inttostr(t.wYear)+'年'+inttostr(t.wMonth)+'月'+inttostr(t.wDay)+'日';<br>end;<br><br>procedure TForm1.FormCreate(Sender: TObject);<br>begin<br> getlocaltime(t);<br> panel1.Caption:=inttostr(t.wHour)+':'+inttostr(t.wMinute);<br>// panel1.Hint:=inttostr(t.wYear)+'年'+inttostr(t.wMonth)+'月'+inttostr(t.wDay)+'日';<br>end;<br><br>end.