AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Timer ohne Formular

Ein Thema von meisteralex · begonnen am 25. Nov 2005 · letzter Beitrag vom 27. Nov 2005
 
Benutzerbild von sniper_w
sniper_w

Registriert seit: 11. Dez 2004
Ort: Wien, Österriech
893 Beiträge
 
Delphi 6 Enterprise
 
#10

Re: Timer ohne Formular

  Alt 27. Nov 2005, 09:37
Einfach gesagt, ich habe recht .
Delphi-Quellcode:
var
  Form1:TForm1;
  myTimer:TMyTimer;

procedure TForm1.Button1Click(Sender: TObject);
begin
 edit1.Text := DateTimeToStr( Now );
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
  myTimer := TMyTimer.Create( 0 );
  myTimer.OnTimer := Button1Click;
end;

procedure TForm1.FormDestroy(Sender: TObject);
begin
  myTimer.Free;
end;
ABER, die TimerCallback muss dann so aussehen ( LEIDER... ):
Delphi-Quellcode:
procedure TimerCallBack( Hwnd_ : HWND; // handle of window for timer messages
                        uMsg :UINT; // WM_TIMER message
                        idEvent :UINT; // timer identifier <- das wird jetzt ignoriert....
                        dwTime :DWORD // current system time
                        );stdcall;
  //var CallingTimer:TMyTimer;
begin
  //CallingTimer := TMyTimer(idEvent);
  //CallingTimer.DoTimerProc();
  myTimer.DoTimerProc;
end;
und das nur weil nIDEvent Parameter ignoriert wird.
Zitat:
hWnd

Identifies the window to be associated with the timer. This window must be owned by the calling thread. If this parameter is NULL, no window is associated with the timer and the nIDEvent parameter is ignored.
Katura Haris
Es (ein gutes Wort) ist wie ein guter Baum, dessen Wurzel fest ist und dessen Zweige in den Himmel reichen.
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 04:55 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz