请问delphi中若不用timer控件,怎样利用时间函数完成定时执行任务的功能

解决方案 »

  1.   

    UINT_PTR SetTimer(
      HWND hWnd,              // handle to window
      UINT_PTR nIDEvent,      // timer identifier
      UINT uElapse,           // time-out value
      TIMERPROC lpTimerFunc   // timer procedure
    );              <----设置定时BOOL KillTimer(
      HWND hWnd,          // handle to window
      UINT_PTR uIDEvent   // timer identifier
    );              <----终止定时
      

  2.   

    用API函数timeSetEvent
     
    The timeSetEvent function starts a specified timer event. The multimedia timer runs in its own thread. After the event is activated, it calls the specified callback function or sets or pulses the specified event object.MMRESULT timeSetEvent(
      UINT uDelay,                
      UINT uResolution,           
      LPTIMECALLBACK lpTimeProc,  
      DWORD dwUser,               
      UINT fuEvent                
    );