Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- The Guide to Clip-4-Win version 3.0 - <b>settimer()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
SetTimer()
Start a timer for a window
------------------------------------------------------------------------------

Syntax
SetTimer( <hWnd>, <nTimer>, <nMilliSecs> )   -->   hTimer

Arguments
<hWnd> is the handle to the window to be sent timer messages
(events).

<nTimer> is a non-zero integer specifying the timer number.
Usually the first is specified as 1 (one), the next 2 (two),
etc.

<nMilliSecs> is the time between timer events, in milli-seconds.

Returns
If successful, a handle to the new timer is returned as an
integer.  Otherwise, zero (0) is returned.

Description
This function can be used to make sure an application will be
kept running from time to time, even if no other events occur.
Also, you can detect inactivity.

The timer keeps sending events every <nMilliSecs> unless the
KillTimer() function is called.

If you have more than one timer active, the timer that caused
a particular event can be found by calling the _lastwParam()
function, as shown below.

Example
SetTimer( hWnd, 1, 10000 )         // every 10 seconds

// main event loop:
do while .t.
     do while ( ev := ChkEvent() ) == EVENT_NONE
     enddo
     do case
     case ev == EVENT_TIMER
          hTimer = _lastwParam()       // get timer
          //  .
          //  .
          //  .
     // case ev == EVENT_ . . .
     endcase
enddo


See Also: KillTimer()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson