> 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. 

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

Reply via email to