虽然Win95下可视化开发工具如VC、Delphi、C++ Builder等都有专用的定时器控件Timer,而且使用很方便,可以实现一定的定时功能,但最小计时精度仅为55ms,且定时器消息在多任务操作系统中的优先级很低,不能得到及时响应,往往不能满足实时控制环境下的应用。不过Microsoft公司在Win32 API函数库中已经为用户提供了一组用于高精度计时的底层函数,如果用户使用得当,计时精度可到1ms。这个计时精度、对于一般的实时系统控制完全可以满足要求。现将由C++ Builder 4.0提供的重新封装后的一组与时间相关的主要接口函数(函数名、参数、功能与Win32 API基本相同)说明如下:
1.DWORD timeGetTime(void)
返回从Windows启动开始经过的毫秒数。最大值为232,约49.71天。
2.MMRESULT timeSetEvent(
UINT uDelay,
UINT uResolution,
LPTIMECALLBACK lpTimeProc,
DWORD dwUser,
UINT fuEvent)
该函数设置一个定时回调事件,此事件可以是一个一次性事件或周期性事件。事件一旦被激活,便调用指定的回调函数,成功后返回事件的标识符代码,否则返回NULL。参数说明如下:
uDelay:以毫秒指定事件的周期。
UResolution:以毫秒指定延时的精度,数值越小定时器事件分辨率越高。缺省值为1ms。
LpTimeProc:指向一个回调函数。
DwUser:存放用户提供的回调数据。
FuEvent:指定定时器事件类型:
TIME_ONESHOT:uDelay毫秒后只产生一次事件
TIME_PERIODIC :每隔uDelay毫秒周期性地产生事件。
3.MMRESULT timeKillEvent(UINT uTimerID)
该函数取消一个指定的定时器回调事件。uTimerID标识要取消的事件(由timeSetEvent函数返回的标识符)。如果成功则返回TIMERR_NOERROR,如果定时器时间不存在则返回MMSYSERR_INVALPARAM。
4.回调函数
void CALLBACK TimeProc(
UINT uID,
UINT uMsg,
DWORD dwUser,
DWORD dw1,
DWORD dw2);
该函数是一个应用程序定义的回调函数,出现定时器事件时该函数被调用。TimeProc是应用程序定义的函数名的占位符。使用该函数
时要注意的是,它只能调用以下有限的几组API函数:PostMessage,timeGetSystemTime, timeGetTime, timeSetEvent,timeKillEvent
,midiOutShortMsg, midiOutLongMsg,OutputDebugString。同时也不要使用完成时间很长的API函数,程序尽可能简短。
使用以上一组函数就可以完成毫秒级精度的计时和控制(在C++Builder中使用时要将头文件mmsystem.h加到程序中)。由于将定时控
制精确到几毫秒,定时器事件将占用大量的CPU时间和系统资源,所以在满足控制要求的前提下,应尽量将参数uResolution的数值增大。而
且定时器实时控制功能完成后要尽快释放。
注意以下几点问题:
一、回调函数的参数不能有误,否则可能引起程序崩掉;
二、事件调用周期uDelay不能小于事件处理时间,否则会引起程序崩溃;
三、通过dwUser给回调函数传递参数
例程如下:
1.DWORD timeGetTime(void)
返回从Windows启动开始经过的毫秒数。最大值为232,约49.71天。
2.MMRESULT timeSetEvent(
UINT uDelay,
UINT uResolution,
LPTIMECALLBACK lpTimeProc,
DWORD dwUser,
UINT fuEvent)
该函数设置一个定时回调事件,此事件可以是一个一次性事件或周期性事件。事件一旦被激活,便调用指定的回调函数,成功后返回事件的标识符代码,否则返回NULL。参数说明如下:
uDelay:以毫秒指定事件的周期。
UResolution:以毫秒指定延时的精度,数值越小定时器事件分辨率越高。缺省值为1ms。
LpTimeProc:指向一个回调函数。
DwUser:存放用户提供的回调数据。
FuEvent:指定定时器事件类型:
TIME_ONESHOT:uDelay毫秒后只产生一次事件
TIME_PERIODIC :每隔uDelay毫秒周期性地产生事件。
3.MMRESULT timeKillEvent(UINT uTimerID)
该函数取消一个指定的定时器回调事件。uTimerID标识要取消的事件(由timeSetEvent函数返回的标识符)。如果成功则返回TIMERR_NOERROR,如果定时器时间不存在则返回MMSYSERR_INVALPARAM。
4.回调函数
void CALLBACK TimeProc(
UINT uID,
UINT uMsg,
DWORD dwUser,
DWORD dw1,
DWORD dw2);
该函数是一个应用程序定义的回调函数,出现定时器事件时该函数被调用。TimeProc是应用程序定义的函数名的占位符。使用该函数
时要注意的是,它只能调用以下有限的几组API函数:PostMessage,timeGetSystemTime, timeGetTime, timeSetEvent,timeKillEvent
,midiOutShortMsg, midiOutLongMsg,OutputDebugString。同时也不要使用完成时间很长的API函数,程序尽可能简短。
使用以上一组函数就可以完成毫秒级精度的计时和控制(在C++Builder中使用时要将头文件mmsystem.h加到程序中)。由于将定时控
制精确到几毫秒,定时器事件将占用大量的CPU时间和系统资源,所以在满足控制要求的前提下,应尽量将参数uResolution的数值增大。而
且定时器实时控制功能完成后要尽快释放。
注意以下几点问题:
一、回调函数的参数不能有误,否则可能引起程序崩掉;
二、事件调用周期uDelay不能小于事件处理时间,否则会引起程序崩溃;
三、通过dwUser给回调函数传递参数
例程如下:
1 id="iframe_0.39669284021359874" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://www.cppblog.com/Images/OutliningIndicators/None.gif?_=2076507%22%20style=%22border:none;max-width:810px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.39669284021359874',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="border-width: initial; border-style: none; width: 11px; height: 16px;">MMRESULT g_wTimerID = 0;
// 回调函数,参数不能有错
2 id="iframe_0.26840218793918136" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://www.cppblog.com/Images/OutliningIndicators/None.gif?_=2076507%22%20style=%22border:none;max-width:810px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.26840218793918136',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="border-width: initial; border-style: none; width: 0px; height: 0px;"> void CALLBACK CDsisiiDlg::SendFun(UINT wTimerID, UINT msg, DWORD dwUser, DWORD dwl, DWORD dw2)
3 id="iframe_0.32506629128855935" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://www.cppblog.com/Images/OutliningIndicators/ExpandedBlockStart.gif?_=2076507%22%20style=%22border:none;max-width:810px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.32506629128855935',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="border-width: initial; border-style: none; width: 11px; height: 16px;"> id="iframe_0.9978135863783331" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://www.cppblog.com/Images/OutliningIndicators/ContractedBlock.gif?_=2076507%22%20style=%22border:none;max-width:810px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.9978135863783331',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="border-width: initial; border-style: none; width: 11px; height: 16px;"> {
CDsisiiDlg* pdcpackerdlg = (CDsisiiDlg*)dwUser;
...
4 id="iframe_0.9425523363144843" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://www.cppblog.com/Images/OutliningIndicators/ExpandedBlockEnd.gif?_=2076507%22%20style=%22border:none;max-width:810px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.9425523363144843',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="border-width: initial; border-style: none; width: 11px; height: 16px;">}
5 id="iframe_0.6072426385193179" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://www.cppblog.com/Images/OutliningIndicators/None.gif?_=2076507%22%20style=%22border:none;max-width:810px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.6072426385193179',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="border-width: initial; border-style: none; width: 0px; height: 0px;">
6 id="iframe_0.8285243316559923" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://www.cppblog.com/Images/OutliningIndicators/None.gif?_=2076507%22%20style=%22border:none;max-width:810px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.8285243316559923',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="border-width: initial; border-style: none; width: 0px; height: 0px;"> bool CDsisiiDlg::CreateTimer()
7 id="iframe_0.1375081482645253" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://www.cppblog.com/Images/OutliningIndicators/ExpandedBlockStart.gif?_=2076507%22%20style=%22border:none;max-width:810px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.1375081482645253',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="border-width: initial; border-style: none; width: 0px; height: 0px;"> id="iframe_0.8226382160414154" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://www.cppblog.com/Images/OutliningIndicators/ContractedBlock.gif?_=2076507%22%20style=%22border:none;max-width:810px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.8226382160414154',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="border-width: initial; border-style: none; width: 0px; height: 0px;"> {
8 id="iframe_0.16080849617744675" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif?_=2076507%22%20style=%22border:none;max-width:810px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.16080849617744675',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="border-width: initial; border-style: none; width: 11px; height: 16px;"> TIMECAPS tc;
9 id="iframe_0.452279226622617" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif?_=2076507%22%20style=%22border:none;max-width:810px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.452279226622617',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="border-width: initial; border-style: none; width: 0px; height: 0px;"> UINT wTimerRes;
10 id="iframe_0.11148038303263963" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif?_=2076507%22%20style=%22border:none;max-width:810px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.11148038303263963',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="border-width: initial; border-style: none; width: 0px; height: 0px;">
11 id="iframe_0.5386000669419346" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif?_=2076507%22%20style=%22border:none;max-width:810px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.5386000669419346',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="border-width: initial; border-style: none; width: 0px; height: 0px;"> // 设置多媒体定时器
12 id="iframe_0.2583203482180787" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif?_=2076507%22%20style=%22border:none;max-width:810px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.2583203482180787',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="border-width: initial; border-style: none; width: 0px; height: 0px;"> if(timeGetDevCaps(&tc, sizeof(TIMECAPS))!=TIMERR_NOERROR) // 向机器申请一个多媒体定时器
13 id="iframe_0.646827243822319" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif?_=2076507%22%20style=%22border:none;max-width:810px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.646827243822319',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="border-width: initial; border-style: none; width: 0px; height: 0px;"> return false;
14 id="iframe_0.18966910899594303" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif?_=2076507%22%20style=%22border:none;max-width:810px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.18966910899594303',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="border-width: initial; border-style: none; width: 0px; height: 0px;">
15 id="iframe_0.351304508486032" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif?_=2076507%22%20style=%22border:none;max-width:810px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.351304508486032',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="border-width: initial; border-style: none; width: 0px; height: 0px;"> // 获得机器允许的时间间隔(一般可达到1毫秒)
16 id="iframe_0.2411039287755652" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif?_=2076507%22%20style=%22border:none;max-width:810px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.2411039287755652',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="border-width: initial; border-style: none; width: 0px; height: 0px;"> wTimerRes=min(max(tc.wPeriodMin,1),tc.wPeriodMax);
17 id="iframe_0.7015596243018987" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif?_=2076507%22%20style=%22border:none;max-width:810px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.7015596243018987',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="border-width: initial; border-style: none; width: 0px; height: 0px;">
18 id="iframe_0.40416008975912576" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif?_=2076507%22%20style=%22border:none;max-width:810px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.40416008975912576',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="border-width: initial; border-style: none; width: 0px; height: 0px;"> // 定时器开始工作
19 id="iframe_0.6034229864242697" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif?_=2076507%22%20style=%22border:none;max-width:810px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.6034229864242697',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="border-width: initial; border-style: none; width: 0px; height: 0px;"> timeBeginPeriod(wTimerRes);
20 id="iframe_0.43820020232975376" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif?_=2076507%22%20style=%22border:none;max-width:810px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.43820020232975376',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="border-width: initial; border-style: none; width: 0px; height: 0px;">
21 id="iframe_0.3566042882177145" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif?_=2076507%22%20style=%22border:none;max-width:810px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.3566042882177145',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="border-width: initial; border-style: none; width: 0px; height: 0px;"> // 每过6毫秒调用回调函数timerback(),wTimerID为定时器ID.TIME_PERIODIC表周期性调用,TIME_ONESHOT表只产生一次事件
22 id="iframe_0.864238866118515" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif?_=2076507%22%20style=%22border:none;max-width:810px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.864238866118515',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="border-width: initial; border-style: none; width: 0px; height: 0px;"> g_wTimerID = timeSetEvent(6, wTimerRes, (LPTIMECALLBACK)SendFun, (DWORD)this, TIME_PERIODIC);
23 id="iframe_0.5677415964061601" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif?_=2076507%22%20style=%22border:none;max-width:810px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.5677415964061601',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="border-width: initial; border-style: none; width: 0px; height: 0px;"> if(g_wTimerID == 0)
24 id="iframe_0.841050054578449" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif?_=2076507%22%20style=%22border:none;max-width:810px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.841050054578449',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="border-width: initial; border-style: none; width: 0px; height: 0px;"> return false;
25 id="iframe_0.5492651185398048" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif?_=2076507%22%20style=%22border:none;max-width:810px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.5492651185398048',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="border-width: initial; border-style: none; width: 0px; height: 0px;">
26 id="iframe_0.5750482219138862" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif?_=2076507%22%20style=%22border:none;max-width:810px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.5750482219138862',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="border-width: initial; border-style: none; width: 0px; height: 0px;"> return true;
27 id="iframe_0.8659279448045307" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://www.cppblog.com/Images/OutliningIndicators/ExpandedBlockEnd.gif?_=2076507%22%20style=%22border:none;max-width:810px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.8659279448045307',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="border-width: initial; border-style: none; width: 0px; height: 0px;">}
28 id="iframe_0.5095701245034643" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://www.cppblog.com/Images/OutliningIndicators/None.gif?_=2076507%22%20style=%22border:none;max-width:810px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.5095701245034643',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="border-width: initial; border-style: none; width: 0px; height: 0px;">
29 id="iframe_0.11789756791675998" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://www.cppblog.com/Images/OutliningIndicators/None.gif?_=2076507%22%20style=%22border:none;max-width:810px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.11789756791675998',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="border-width: initial; border-style: none; width: 0px; height: 0px;"> // 删除定时器
30 id="iframe_0.6399010077757481" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://www.cppblog.com/Images/OutliningIndicators/None.gif?_=2076507%22%20style=%22border:none;max-width:810px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.6399010077757481',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="border-width: initial; border-style: none; width: 0px; height: 0px;"> void CDsisiiDlg::DestroyTimer()
31 id="iframe_0.9028866430435323" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://www.cppblog.com/Images/OutliningIndicators/ExpandedBlockStart.gif?_=2076507%22%20style=%22border:none;max-width:810px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.9028866430435323',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="border-width: initial; border-style: none; width: 0px; height: 0px;"> id="iframe_0.23058819224145144" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://www.cppblog.com/Images/OutliningIndicators/ContractedBlock.gif?_=2076507%22%20style=%22border:none;max-width:810px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.23058819224145144',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="border-width: initial; border-style: none; width: 0px; height: 0px;"> {
32 id="iframe_0.2817801432979643" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif?_=2076507%22%20style=%22border:none;max-width:810px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.2817801432979643',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="border-width: initial; border-style: none; width: 0px; height: 0px;"> if (g_wTimerID)
33 id="iframe_0.39866392050584754" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://www.cppblog.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif?_=2076507%22%20style=%22border:none;max-width:810px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.39866392050584754',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="border-width: initial; border-style: none; width: 11px; height: 16px;"> id="iframe_0.9668462378162153" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://www.cppblog.com/Images/OutliningIndicators/ContractedSubBlock.gif?_=2076507%22%20style=%22border:none;max-width:810px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.9668462378162153',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="border-width: initial; border-style: none; width: 11px; height: 16px;"> {
34 id="iframe_0.27652878566602346" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif?_=2076507%22%20style=%22border:none;max-width:810px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.27652878566602346',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="border-width: initial; border-style: none; width: 0px; height: 0px;"> timeKillEvent(g_wTimerID);
35 id="iframe_0.5043294590378999" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif?_=2076507%22%20style=%22border:none;max-width:810px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.5043294590378999',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="border-width: initial; border-style: none; width: 0px; height: 0px;"> g_wTimerID = 0;
36 id="iframe_0.23222339239761247" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://www.cppblog.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif?_=2076507%22%20style=%22border:none;max-width:810px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.23222339239761247',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="border-width: initial; border-style: none; width: 11px; height: 16px;"> }
37 id="iframe_0.09996064023202278" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://www.cppblog.com/Images/OutliningIndicators/ExpandedBlockEnd.gif?_=2076507%22%20style=%22border:none;max-width:810px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.09996064023202278',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="border-width: initial; border-style: none; width: 0px; height: 0px;">}