This example uses the WinStartTimer call to add up elapsed seconds.

#define INCL_WINTIMER
#include <OS2.H>

HAB hab;                /* Anchor-block handle               */
ULONG seconds;
ULONG  msg;

WinStartTimer(hab,
              (HWND)0,
              0,        /* Ignored as previous parm. is null */
              1000UL);

switch(msg)
{
  case WM_TIMER:
       seconds += 1;
       break;
}


[Back] [Next]