|
|
废话少叙。
理解DisplayTime( )是理解本程序的核心!
此函数如下所示:
void DisplayTime (HDC hdc, BOOL f24Hour, BOOL fSuppress)
{
SYSTEMTIME st ;
GetLocalTime(&st) ;
if (f24Hour)
DisplayTwoDigits (hdc, st.wHour, fSuppress) ;
else
DisplayTwoDigits (hdc, (st.wHour %= 12) ? st.wHour : 12, fSuppress) ;
DisplayColon (hdc) ;
DisplayTwoDigits (hdc, st.wMinute, FALSE) ;
DisplayColon (hdc) ;
DisplayTwoDigits (hdc, st.wSecond, FALSE) ;
}
首先,此函数用GetLocalTime(&st)取得当前的时间,st的结构如下:
[1] [2] [3] [4] [5] [6] [7] [8] [9] [10] 下一页
网友评论:(评论内容只代表网友观点,与本站立场无关!) |
阅读排行
|