⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 wtlclock2view.cpp

📁 WTL框架下的对话框程序
💻 CPP
字号:
// WTLClock2View.cpp : implementation of the CWTLClock2View class
//
/////////////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "resource.h"

#include "WTLClock2View.h"

BOOL CWTLClock2View::PreTranslateMessage(MSG* pMsg)
{
    pMsg;
    return FALSE;
}

LRESULT CWTLClock2View::OnPaint(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
CPaintDC dc(m_hWnd);
CRect    rc;
CString  sTime;

    // Get our window's client area.
    GetClientRect ( rc );

    // Build the string to show in the window.
    if ( m_bClockRunning )
        {
        sTime.Format ( _T("The time is %d:%02d:%02d"), 
                       m_stLastTime.wHour, m_stLastTime.wMinute, m_stLastTime.wSecond );
        }
    else
        {
        sTime.Format ( _T("Clock stopped on %d:%02d:%02d"), 
                       m_stLastTime.wHour, m_stLastTime.wMinute, m_stLastTime.wSecond );
        }

    // Set up the DC and draw the text.
    dc.SaveDC();
    
    dc.SetBkColor ( m_crBkgnd );
    dc.SetTextColor ( m_crText );
    dc.ExtTextOut ( 0, 0, ETO_OPAQUE, rc, sTime, sTime.GetLength(), NULL );

    // Restore the DC.
    dc.RestoreDC(-1);
    return 0;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -