Dim sw As New System.Diagnostics.Stopwatch '秒表 sw.Start() '---开始秒表计时---sw.Stop() '---停止秒表---
timeSetEventThe 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 );Return Values Returns an identifier for the timer event if successful or an error otherwise. This function returns NULL if it fails and the timer event was not created. (This identifier is also passed to the callback function.)
在OnTimer中,GetTickCount,和开始时得到的时间相减(PassTime),得到经过的时间,更新Edit box;STOP时,KillTimer()Clear,StartTime = GetTickCount; //更新开始时间。
sw.Start() '---开始秒表计时---sw.Stop() '---停止秒表---
timeSetEventThe 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
);Return Values
Returns an identifier for the timer event if successful or an error otherwise. This function returns NULL if it fails and the timer event was not created. (This identifier is also passed to the callback function.)
LZ加油啊
到这个网址去下这个源码分析一下:
http://www.vckbase.com/document/viewdoc/?id=1745