![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
#pragma comment(lib,"user32")
#include <windows.h>
#include <time.h>
char HHMM[6];
time_t t;
int i,r;
int main()
{
while (1)
{
for (i=0;i<10;i++)
Sleep(1000);
time(&t);
strftime(HHMM,6,"%H:%M",localtime(&t));
if (IDCANCEL==MessageBox(NULL,HHMM,"Time",MB_OKCANCEL|MB_SETFOREGROUND))
break;
}
return 0;
}