下面代码是使用 DuiLib 创建一个界面所需的最小化框架。
#include <UIlib.h> using namespace DuiLib; #ifdef _DEBUG # ifdef _UNICODE # pragma comment(lib, "DuiLib_ud.lib") # else # pragma comment(lib, "DuiLib_d.lib") # endif #else # ifdef _UNICODE # pragma comment(lib, "DuiLib_u.lib") # else # pragma comment(lib, "DuiLib.lib") # endif #endif class CDuiWnd : public WindowImplBase { public: CDuiWnd () = default; virtual ~CDuiWnd () = default; public: virtual LPCTSTR GetWindowClassName() const { return _T("DuiWnd "); } virtual CDuiString GetSkinFile() { return _T("duilibb.xml"); } virtual CDuiString GetSkinFolder() { return _T(".\\"); } //virtual void Notify(TNotifyUI &msg){} //virtual LRESULT MessageHandler(UINT uMsg, WPARAM wParam, LPARAM /*lParam*/, bool& /*bHandled*/); }; int _stdcall _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow) { CPaintManagerUI::SetInstance(hInstance); CPaintManagerUI::SetResourcePath(CPaintManagerUI::GetInstancePath()); CDuiWnd wnd; wnd.Create(NULL, _T("DuiWnd "), UI_CLASSSTYLE_FRAME, 0, 0, 0, 400, 400); wnd.CenterWindow(); wnd.ShowModal(); return 0; }
本文出自 “whatever957” 博客,请务必保留此出处http://whatever957.blog.51cto.com/6835003/1657675
原文地址:http://whatever957.blog.51cto.com/6835003/1657675