码迷,mamicode.com
首页 > Windows程序 > 详细

基于WindowImplBase 更简单,才是标准的

时间:2021-06-02 13:22:22      阅读:0      评论:0      收藏:0      [点我收藏+]

标签:const   标准   gets   path   instance   void   cep   tno   file   

dui界面基于

https://github.com/dingyuanhong/dui_ffplay/

常用的教程  https://github.com/jiangrongbo/duilib-tutorial

extern "C"
{
#include "common.h" //ff相关
}

#include <Windows.h>

#include "../DuiLib/UIlib.h"

using namespace DuiLib;
#pragma comment(lib,"../lib/DuiLib_u.lib")

class MyWnd : public WindowImplBase{
    LPCTSTR GetWindowClassName() const{
        return L"MyWnd";
    }
    UINT GetClassStyle() const{
        return UI_CLASSSTYLE_FRAME | CS_DBLCLKS;
    }
    CDuiString GetSkinFile(){
        return L"UFPlayer.xml";
    }
    CDuiString GetSkinFolder(){
        return CPaintManagerUI::GetResourcePath();
    }
    void Notify(TNotifyUI& msg){
        if (msg.sType == L"click"){
            if (msg.pSender->GetName() == L"IDCLOSE"){
                ::PostQuitMessage(0);
            }
            else if (msg.pSender->GetName() == L"IDSTOP"){
                ::SendMessage(m_hWnd, WM_SYSCOMMAND, SC_MINIMIZE, 0);
            }
        }
    }
};

int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow){
    CPaintManagerUI::SetInstance(hInstance);
    CPaintManagerUI::SetResourcePath(CPaintManagerUI::GetResourcePath());
    //创建主窗口
    MyWnd* pFrame = new MyWnd();
    pFrame->Create(NULL, L"Tutorial5", UI_WNDSTYLE_FRAME^WS_THICKFRAME, WS_EX_WINDOWEDGE);
    pFrame->CenterWindow();
    pFrame->ShowWindow(true);
    CPaintManagerUI::MessageLoop();
    return 0;
}

 

基于WindowImplBase 更简单,才是标准的

标签:const   标准   gets   path   instance   void   cep   tno   file   

原文地址:https://www.cnblogs.com/cnchengv/p/14819165.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!