// CustomWnd.cpp : 实现文件
//

#include "stdafx.h"
#include "CustomWnd.h"
#include "demoTools.h"

// CustomWnd

IMPLEMENT_DYNAMIC(CustomWnd, CWnd)

CustomWnd::CustomWnd(int width, int height, DWORD exStyle, DWORD style)
{
    LPCTSTR className = AfxRegisterWndClass(CS_VREDRAW | CS_HREDRAW, LoadCursor(NULL, IDC_ARROW) , (HBRUSH)GetStockObject(GRAY_BRUSH), AfxGetApp()->LoadIcon(174));
    CreateEx(exStyle, className, _T("CustomWnd"), style, CW_USEDEFAULT, CW_USEDEFAULT, width, height, NULL, NULL, NULL);
}

CustomWnd::~CustomWnd()
{
}

void CustomWnd::OnLButtonDblClk(UINT nFlags, CPoint point)
{
    ostringstream hwndStream;
    hwndStream << m_hWnd;
    string tips = "----- OnLButtonDblClick, m_hWnd =" + hwndStream.str();
    CTools::OutputRetStr(tips);
}

void CustomWnd::OnSize(UINT nType, int cx, int cy)
{
    string tips = "CustomWnd::OnSize nType =" + std::to_string(nType);
    tips += ", cx = " + std::to_string(cx);
    tips += ", cy = " + std::to_string(cy);
    CTools::OutputRetStr(tips);
}

int CustomWnd::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
    string tips = "CustomWnd::OnCreate";
    CTools::OutputRetStr(tips);

    return 0;
}

BEGIN_MESSAGE_MAP(CustomWnd, CWnd)
    ON_WM_LBUTTONDBLCLK()
    ON_WM_SIZE()
    ON_WM_CREATE()
END_MESSAGE_MAP()



// CustomWnd 消息处理程序


