56 lines
1.2 KiB
C++
56 lines
1.2 KiB
C++
![]() |
// VirtualBox.cpp : <20><><EFBFBD><EFBFBD>Ӧ<EFBFBD>ó<EFBFBD><C3B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڵ㡣
|
|||
|
//
|
|||
|
|
|||
|
#include "stdafx.h"
|
|||
|
#include "main.h"
|
|||
|
#include "main_form.h"
|
|||
|
#include "VirtualTileBox.h"
|
|||
|
|
|||
|
ui::Control* MyCreateControlCallback(const std::wstring& sName)
|
|||
|
{
|
|||
|
if (sName == L"VirtualTileBox")
|
|||
|
{
|
|||
|
return new VirtualTileBox();
|
|||
|
}
|
|||
|
return nullptr;
|
|||
|
}
|
|||
|
|
|||
|
int APIENTRY wWinMain(_In_ HINSTANCE hInstance,
|
|||
|
_In_opt_ HINSTANCE hPrevInstance,
|
|||
|
_In_ LPWSTR lpCmdLine,
|
|||
|
_In_ int nCmdShow)
|
|||
|
{
|
|||
|
UNREFERENCED_PARAMETER(hPrevInstance);
|
|||
|
UNREFERENCED_PARAMETER(lpCmdLine);
|
|||
|
|
|||
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>߳<EFBFBD>
|
|||
|
MainThread thread;
|
|||
|
|
|||
|
// ִ<><D6B4><EFBFBD><EFBFBD><EFBFBD>߳<EFBFBD>ѭ<EFBFBD><D1AD>
|
|||
|
thread.RunOnCurrentThreadWithLoop(nbase::MessageLoop::kUIMessageLoop);
|
|||
|
|
|||
|
return 0;
|
|||
|
}
|
|||
|
|
|||
|
void MainThread::Init()
|
|||
|
{
|
|||
|
nbase::ThreadManager::RegisterThread(kThreadUI);
|
|||
|
|
|||
|
// <20><>ȡ<EFBFBD><C8A1>Դ·<D4B4><C2B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><CABC>ȫ<EFBFBD>ֲ<EFBFBD><D6B2><EFBFBD>
|
|||
|
std::wstring theme_dir = QPath::GetAppPath();
|
|||
|
ui::GlobalManager::Startup(theme_dir + L"resources\\", MyCreateControlCallback, false);
|
|||
|
|
|||
|
// <20><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>Ĭ<EFBFBD>ϴ<EFBFBD><CFB4><EFBFBD><EFBFBD><EFBFBD>Ӱ<EFBFBD>ľ<EFBFBD><C4BE>д<EFBFBD><D0B4><EFBFBD>
|
|||
|
MainForm* window = new MainForm();
|
|||
|
window->Create(NULL, MainForm::kClassName.c_str(), WS_OVERLAPPEDWINDOW & ~WS_MAXIMIZEBOX, 0);
|
|||
|
window->CenterWindow();
|
|||
|
window->ShowWindow();
|
|||
|
}
|
|||
|
|
|||
|
void MainThread::Cleanup()
|
|||
|
{
|
|||
|
ui::GlobalManager::Shutdown();
|
|||
|
SetThreadWasQuitProperly(true);
|
|||
|
nbase::ThreadManager::UnregisterThread();
|
|||
|
}
|