初始化对话框时设置定时器SetTimer(hwnd, 1, 1000, TimerProc);

时间到后回调的处理函数:

VOID CALLBACK TimerProc(HWND hwnd, UINT message, UINT iTimerID, DWORD dwTime)
{
 SYSTEMTIME stTime;
 GetLocalTime(&stTime);
 TCHAR cResult[256];
 wsprintf(cResult, TEXT("%d-%02d-%02d %02d:%02d:%02d"), stTime.wYear, stTime.wMonth, stTime.wDay, stTime.wHour, stTime.wMinute, stTime.wSecond);
 SetDlgItemText(hwnd, IDC_EDTTIME, cResult);
}

wsprintf参考资料:http://baike.baidu.com/view/849487.htm

Clock