資源簡介
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;
}
評論
共有 條評論