资源简介

cef封装为duilib的控件,支持离屏渲染、mp3mp4

资源截图

代码片段和文件信息

#include “stdafx.h“

#include “WndMainframe.h“

int APIENTRY _tWinMain(_In_ HINSTANCE hInstance
_In_opt_ HINSTANCE hPrevInstance
_In_ LPTSTR    lpCmdLine
_In_ int       nCmdShow)
{
UNREFERENCED_PARAMETER(hPrevInstance);
UNREFERENCED_PARAMETER(lpCmdLine);

//cef初始化
bool is_multi_threaded_message_loop bRet;
CefMainInit cef_main_init(hInstance is_multi_threaded_message_loop bRet);
if (!bRet)
{
//cef初始化失败
return -1;
}

//duilib初始化
CPaintManagerUI::SetInstance(hInstance);
CPaintManagerUI::SetResourcePath(CPaintManagerUI::GetInstancePath() + _T(“Skin\\“));
HRESULT Hr = ::CoInitialize(NULL);
if (FAILED(Hr))
return 0;

CWndMainframe *mainframe = new CWndMainframe;
mainframe->Create(NULL _T(““) /*UI_WNDstyle_DIALOG*/WS_POPUP 0 0 0);
mainframe->CenterWindow();
mainframe->ShowWindow();

if (is_multi_threaded_message_loop)
{
//CPaintManagerUI::MessageLoop();

CMainMessageLoopWin main_message_loop;
main_message_loop.Run();
}
else
{
CefRunMessageLoop();
}


CefShutdown();

::CoUninitialize();

return 0;
}

评论

共有 条评论