Angus Robertson - Magenta Systems Ltd wrote: >> Unfortunately the callback requires a window handle as well. > > But zero is fine for the handle. I use this code in a DLL to close > a database on inactivity.
Thanks Angus, sometimes, especially after a 16 hours day it may happen that I even forget the meaning of a simple callback, it's high time to go fishing ;-) > > Angus > > procedure TimerProc (Wnd: HWnd; Msg: Integer; Id: Integer; > CurrentTime: DWord) ; stdcall ; > begin > SetTimerEnabled (false) ; > doDBClose ; > end; > > procedure SetTimerEnabled (const Value: Boolean); > begin > if TimerEnabled = Value then Exit; > if Value then > begin > TimerHandle := SetTimer (0, 0, TimerInterval, @TimerProc) ; > end > else > begin > if TimerHandle <> 0 then > begin > KillTimer (0, TimerHandle) ; > TimerHandle := 0 ; > end; > end; > TimerEnabled := Value; > end; -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be