Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Win32/Win64 API (native code) (https://www.delphipraxis.net/17-win32-win64-api-native-code/)
-   -   Delphi konsole anwendung und timer ! (https://www.delphipraxis.net/24902-konsole-anwendung-und-timer.html)

agm65 28. Jun 2004 13:37


konsole anwendung und timer !
 
hallo leute ich nochmal....also ich möchte, daß mein progg die befehle alle 5 min ausführt ...kann aber nicht auf den timer zurückgreifen hat da jemand ne idee ?

Tubos 28. Jun 2004 13:40

Re: konsole anwendung und timer !
 
Wenn das Hauptprogramm alle 5 Minuten was machen soll, kannst du sleep verwenden.
Wenn das Hauptprogramm was anderes machen soll und alle 5 Minuten zusätzlich bestimmte Aktionen ausgeführt werden sollen, kannst du entweder mit GetTickCount überprüfen wieviel Zeit vergangen ist oder du erstellst einen Thread mit CreateThread.

Luckie 28. Jun 2004 13:40

Re: konsole anwendung und timer !
 
Eine Schleife mit einem entsprechenden Sleep oder DelayDelay.

agm65 28. Jun 2004 13:42

Re: konsole anwendung und timer !
 
ja ist ne idee !

MartinA 28. Jun 2004 16:19

Re: konsole anwendung und timer !
 
Warum sollte ein Timer nicht gehen ?

Code:
procedure dertimer(WND: Hwnd; uMsg: Word; IdEvent: Word; dwTimer: DWord); stdcall; Far;
begin
   :
   was man halt so in seinem timer tut;
   :
end;

var
TimerHandle : DWord;
begin
   :
   TimerHandle := SetTimer(0, 0, 300000, @dertimer);
   :
   was man halt so in seinem hauptprogramm tut;
   :
   :
   if TimerHandle <> 0 then KillTimer(0, TimerHandle);
end;
Gruß
Martin

[EDIT] Erster Beitrag in DP 8) [/EDIT]


Alle Zeitangaben in WEZ +1. Es ist jetzt 12:00 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz