CDlgMain::InitUI() -> CPngTitleView::Create() -> CPngView::PreCreateWindow -> CPngTitleView::SetBkImage() -> CPngView::SetImage() -> CPngView::OnPaint()
1. 主窗口类CDlgMain:
成员变量:
CPngTitleView m_pngTitleView;
BOOL CDlgMain::InitUI()
{
//调用CPngTitleView中的Create(...)
if (!m_pngTitleView.Create(NULL, NULL, WS_CHILD |WS_VISIBLE | WS_TABSTOP, CRect(0, 0, 800, 59), this, IDC_TITLE_BG, NULL))
{
TRACE0("未创建标题栏背景!");
return FALSE;
}
//调用CPngTitleView中的图片路径SetBkImage()
m_pngT