设为首页 加入收藏

TOP

计时器(十四)
2010-12-30 21:12:14 来源: 作者: 【 】 浏览:16646
Tags:计时器
51, 6, 55 } ;

Polygon (hdc, ptColon [0], 4) ;
Polygon (hdc, ptColon [1], 4) ;

OffsetWindowOrgEx (hdc, -12, 0, NULL) ;
}

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) ;
}
LRESULT CALLBACK WndProc ( HWND hwnd, UINT message, WPARAM wParam,LPARAM lParam)
{
static BOOL f24Hour, fSuppress ;
static HBRUSH hBrushRed ;
static int cxClient, cyClient ;
HDC hdc ;
PAINTSTRUCT ps ;
TCHAR szBuffer [2] ;

switch (message)
{
case WM_CREATE:
hBrushRed = CreateSolidBrush (RGB (255, 0, 0)) ;
SetTimer (hwnd, ID_TIMER, 1000, NULL) ;// fall through

case WM_SETTINGCHANGE:
GetLocaleInfo (LOCALE_USER_DEFAULT, LOCALE_ITIME, szBuffer, 2) ;
f24Hour = (szBuffer[0] == '1') ;

GetLocaleInfo (LOCALE_USER_DEFAULT, LOCALE_ITLZERO, szBuffer, 2) ;
fSuppress = (szBuffer[0] == '0') ;

InvalidateRect (hwnd, NULL, TRU
首页 上一页 11 12 13 14 15 16 17 下一页 尾页 14/27/27
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇子视窗控制项 下一篇滑鼠

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: