Bom, não sei nada de Delphi! Mas preciso desse código que peguei aqui no forum (preciso fazer ele funcionar!) unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
ExtCtrls, StdCtrls, RXClock;
type
TForm1 = class(TForm)
Button1: TButton;
Timer1: TTimer;
RxClock1: TRxClock;
procedure Button1Click(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
lig : integer = 0;
implementation
{$R *.DFM}
function SetNewTime(Hora, Min, Seg: word): boolean;
var
st: TSYSTEMTIME;
begin
GetLocalTime(st); // Pega hora corrente
st.wHour := Hora;
st.wMinute := Min;
st.wSecond := seg;
if not SetLocalTime(st) then
Result := FALSE
else
Result := true;
end;
procedure TForm1.Timer1Timer(Sender: TObject);
var
Present: TDateTime;
Hour, Min, Sec, MSec: word;
hh, mm, ss : shortstring;
begin
Present:= Now;
DecodeTime(Present, Hour, Min, Sec, MSec);
sec := sec - 1; // mantem o relogio parado entre um segundo e outro
hh := IntToStr(hour);
mm := IntToStr(min);
ss := IntToStr(sec);
SetNewTime(StrToInt(hh),StrToInt(mm),StrToInt(ss));
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
lig := lig + 1;
if lig = 1 then
Timer1.Enabled := true
else
begin
Timer1.Enabled := false;
lig := 0;
end;
end;
end. Como estou precisando dele com certa urgência, preferia que alguém fizesse o programa (se não quiser usar esse código tudo bem, desde que o programa pare o relógio do windows XP) e me desse um link para baixá-lo. Se depois disso alguém quiser me ensinar como fazê-lo ficarei grato. (tenho o Delphi 7)