Main.cpp
#include <UIlib.h> using namespace DuiLib; class MainWindow : public WindowImplBase { protected: virtual LPCTSTR GetWindowClassName(void) const { return TEXT("MainWindow"); } virtual CDuiString GetSkinFile() { return TEXT("MainWindow.xml"); } virtual CDuiString GetSkinFolder() { return TEXT(""); } }; int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PTSTR pCmdLine, int nCmdShow) { CPaintManagerUI::SetInstance(hInstance); MainWindow window; window.Create(nullptr, TEXT("主窗口"), UI_WNDSTYLE_FRAME, WS_EX_WINDOWEDGE); window.CenterWindow(); window.ShowModal(); return 0; }
MainWindow.xml
<?xml version="1.0" encoding="utf-8"?> <Window size="350,250"> <HorizontalLayout bkcolor="#FF12B7F5" /> </Window>
效果图