添加WM_TIME消息映射,
在OnTime函数中添加显示图片的代码,
注意要设置SetTimer(0,100,NULL);100是0.1秒,1000是1秒,
在OnTime函数中添加显示图片的代码,
注意要设置SetTimer(0,100,NULL);100是0.1秒,1000是1秒,
解决方案 »
- 知道进程名 如QQ.exe如何终止该进程。
- Error loop up 的问题
- 命名管道对不同机器上的 \\\\.\\pipe\\ 中"."要怎么写?
- ##想了好久不知道怎么办 关于CMap
- 用G729a.lib压缩音频,压缩后数据解压不成功?有谁做过
- 我想定制CstatusBar如何实现?
- 调用IE控件的navigate2()时系统会发出"波"的一声轻响,如何屏蔽?
- CJ60lib界面库的问题。使用过CJ60lib的人请讨论!!!
- 如何让CEDIT不失去焦点
- 请问在对话框里的TabCtrl是什么东西?和属性页有什么区别?
- 如何把Edit控件贴到FlexGrid控件之中?
- 如何获取本地机上的所有路径?
2。在WM_ONTIMER中载入图象
void CAppView::OnStartPict()
{
SetTimer(0,1000,NULL);}void CAppView::OnTimer(UINT nIDEvent)
{
// TODO: Add your message handler code here and/or call default
if ( nIDEvent== TM_LOADPICT )
{
// 处理LOADPICT;
} CView::OnTimer(nIDEvent);
}
UINT wTimerRes;if (timeGetDevCaps(&tc, sizeof(TIMECAPS)) != TIMERR_NOERROR)
{
// Error; application can't continue.
}wTimerRes = min(max(tc.wPeriodMin, TARGET_RESOLUTION), tc.wPeriodMax);
timeBeginPeriod(wTimerRes); Starting a Single Timer EventUINT SetTimerCallback(NPSEQ npSeq, // sequencer data
UINT msInterval) // event interval
{
npSeq->wTimerID = timeSetEvent(
msInterval, // delay
wTimerRes, // resolution (global variable)
OneShotCallback, // callback function
(DWORD)npSeq, // user data
TIME_ONESHOT ); // single timer event
if(! npSeq->wTimerID)
return ERR_TIMER;
else
return ERR_NOERROR;
} Writing a Timer Callback Functionvoid CALLBACK OneShotTimer(UINT wTimerID, UINT msg,
DWORD dwUser, DWORD dw1, DWORD dw2)
{
NPSEQ npSeq; // pointer to sequencer data
npSeq = (NPSEQ)dwUser;
npSeq->wTimerID = 0; // invalidate timer ID (no longer in use)
TimerRoutine(npSeq); // handle tasks
} Canceling a Timer Eventvoid DestroyTimer(NPSEQ npSeq)
{
if(npSeq->wTimerID) { // is timer event pending?
timeKillEvent(npSeq->wTimerID); // cancel the event
npSeq->wTimerID = 0;
}
}
那位大侠有着方面的代码没有?
可发[email protected]
Sleep();//单位是毫秒
不久解决了!!
不用太复杂!!
不过呢,想请你给我看看我的问题!!http://www.csdn.net/expert/topic/675/675963.xml?temp=.3516199
谢谢!!!