Einzelnen Beitrag anzeigen

HolgerX

Registriert seit: 10. Apr 2006
Ort: Leverkusen
961 Beiträge
 
Delphi 6 Professional
 
#34

AW: Timer in einer Unit

  Alt 22. Mär 2015, 03:28
Schau doch mal in den Post Nr. 5 von diesem Thema, da habe ich versucht es zu erklären...

https://msdn.microsoft.com/en-us/lib...(v=vs.85).aspx

Zitat:
nIDEvent [in]
Type: UINT_PTR
A nonzero timer identifier. If the hWnd parameter is NULL, and the nIDEvent does not match an existing timer then it is ignored and a new timer ID is generated. If the hWnd parameter is not NULL and the window specified by hWnd already has a timer with the value nIDEvent, then the existing timer is replaced by the new timer. When SetTimer replaces a timer, the timer is reset. Therefore, a message will be sent after the current time-out value elapses, but the previously set time-out value is ignored. If the call is not intended to replace an existing timer, nIDEvent should be 0 if the hWnd is NULL.

OK, da weiß wohl MS selber nicht was es will.

A nonzero timer identifier.
..nIDEvent should be 0 if the hWnd is NULL


Hi.hi..


Nur ne kleine Anmerkung:

SetTimer( 0, nIDEvent, Interval, @OnTimer );

benötigt eine nIDEvent > 0 !!
Könntest du das einmal erläutern, warum. Dann können wir das bei MS einreichen, auf dass die ihre Doku anpassen, denn die wäre dann ja wohl falsch.

Evtl. liegt es auch daran, dass ich es mir angewöhnt habe den gesamten Abschnitt der Dokumentation zu lesen und nicht nur das erste Schlagwort.

Geändert von HolgerX (22. Mär 2015 um 03:30 Uhr)
  Mit Zitat antworten Zitat