#include "../pch/pch.h" #include "CGameFrameWnd.h" #include "ControlEx.h" void CGameFrameWnd::Init() { m_pCloseBtn = static_cast(m_pm.FindControl(_T("closebtn"))); m_pMaxBtn = static_cast(m_pm.FindControl(_T("maxbtn"))); m_pRestoreBtn = static_cast(m_pm.FindControl(_T("restorebtn"))); m_pMinBtn = static_cast(m_pm.FindControl(_T("minbtn"))); } LRESULT CGameFrameWnd::OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) { LONG styleValue = ::GetWindowLong(*this, GWL_STYLE); styleValue &= ~WS_CAPTION; ::SetWindowLong(*this, GWL_STYLE, styleValue | WS_CLIPSIBLINGS | WS_CLIPCHILDREN); m_pm.Init(m_hWnd); CDialogBuilder builder; CDialogBuilderCallbackEx cb; CControlUI* pRoot = builder.Create(_T("main.xml"), (UINT)0, &cb, &m_pm); ASSERT(pRoot && "Failed to parse XML"); m_pm.AttachDialog(pRoot); m_pm.AddNotifier(this); OrderListUI* orderlist = static_cast(m_pm.FindControl(_T("orderlist"))); orderlist->Refresh(); Init(); return 0; }