代码如下,可是就是不能替代任务栏里时间的那块区域,大虾们帮看看 ……
procedure TForm1.Button1Click(Sender: TObject);
var
wnd:thandle;
recttmp:TRect;
begin
wnd:=findwindow('Shell_TrayWnd',nil);
wnd:=findwindowex(wnd,0,'TrayNotifyWnd',nil);
wnd:=findwindowex(wnd,0,'TrayClockWClass',nil);
GetWindowRect(wnd,recttmp);
form1.Height := recttmp.Bottom - recttmp.Top;
form1.Width := recttmp.Right - recttmp.Left;
form1.Label1.Left := 0;
form1.label1.Top := 0;
windows.SetParent(form1.Handle,wnd);
windows.SetWindowPos(form1.Handle,HWND_TOPMOST,0,0,0,0,3);
end;