您现在的位置: 中国教师站 >> 教师关注 >> 电脑技术 >> 编程技术 >> Visual C >> 正文

Google
Win32学习笔记Timer篇之一 DIGCLOCK程序分析
作者:Siny 文章来源:中国教师站cn-teacher 点击数: 更新时间:2007-4-22 11:34:48

废话少叙。

理解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] 下一页

相关专题:
 
 网友评论:(评论内容只代表网友观点,与本站立场无关!)
GOOGLE广告

阅读排行

| 设为首页 | 加入收藏 | 联系站长 | 友情链接 | 版权申明 |
中国教师站

中国教师站 版权所有 Copyright © 2006-2020 All Rights Reserved 站长:Sina & Siny
[备用域名:www.JXZYW.Com] 有事请留言有事请留言
【实力成就精品 诚信呵护品牌】

信息产业部备案
苏ICP备06018635号