SYSTEMTIME systime;
GetLocalTime(&systime);
TCHAR tcsystime[1024];
_stprintf(tcsystime,"%d/%d/%d,%d:%d:%d:%d ",systime.wYear,systime.wMonth,systime.wDay,systime.wHour,systime.wMinute,systime.wSecond,systime.wMilliseconds);
GetLocalTime(&systime);
TCHAR tcsystime[1024];
_stprintf(tcsystime,"%d/%d/%d,%d:%d:%d:%d ",systime.wYear,systime.wMonth,systime.wDay,systime.wHour,systime.wMinute,systime.wSecond,systime.wMilliseconds);
void CIdeApp::let_msg_go_and_wait(DWORD dwMS)
{
DWORD dwStart;
MSG msg; dwStart=::GetTickCount();
cont_wait:
while ( ::PeekMessage( &msg, NULL, 0, 0, PM_REMOVE ) )
{
if ( msg.message==WM_QUIT )
{
::PostQuitMessage(-1);
break;
}
if (!AfxGetApp()->PreTranslateMessage(&msg))
{
::TranslateMessage(&msg);
::DispatchMessage(&msg);
}
}
AfxGetApp()->OnIdle(0);
AfxGetApp()->OnIdle(1);
if (dwMS==0) return;
if ((::GetTickCount()-dwStart)<dwMS) goto cont_wait;
}
这是消息处理的时间delay,应该可以!
另外CSDN上也有个例子