第三方框架改为仓内子集并完善构建忽略规则
完整 NIM_Duilib_Framework 仓库移至父目录,third_party 仅保留实际使用的 base、duilib、bin/resources 与许可证;.gitignore 覆盖 MSBuild 与打包产物。
This commit is contained in:
1 parent
249e8548de
commit
e1e26acc49
391 files changed
+342850
No files matched your search
@@ -0,0 +1,55 @@
|
||||
#include "stdafx.h"
|
||||
#include "main.h"
|
||||
#include "downloader_form.h"
|
||||
|
||||
enum ThreadId
|
||||
{
|
||||
kThreadUI
|
||||
};
|
||||
|
||||
int APIENTRY wWinMain(_In_ HINSTANCE hInstance,
|
||||
_In_opt_ HINSTANCE hPrevInstance,
|
||||
_In_ LPWSTR lpCmdLine,
|
||||
_In_ int nCmdShow)
|
||||
{
|
||||
UNREFERENCED_PARAMETER(hPrevInstance);
|
||||
UNREFERENCED_PARAMETER(lpCmdLine);
|
||||
UNREFERENCED_PARAMETER(hInstance);
|
||||
UNREFERENCED_PARAMETER(nCmdShow);
|
||||
|
||||
HANDLE instance_mutex = ::CreateMutexW(nullptr, TRUE, L"Local\\TTDownloader.SingleInstance");
|
||||
if (::GetLastError() == ERROR_ALREADY_EXISTS)
|
||||
{
|
||||
HWND hwnd = ::FindWindowW(DownloaderForm::kClassName.c_str(), nullptr);
|
||||
if (hwnd != nullptr)
|
||||
::PostMessageW(hwnd, DownloaderForm::kShowMainWindowMessage, 0, 0);
|
||||
::CloseHandle(instance_mutex);
|
||||
return 0;
|
||||
}
|
||||
|
||||
MainThread thread;
|
||||
thread.RunOnCurrentThreadWithLoop(nbase::MessageLoop::kUIMessageLoop);
|
||||
|
||||
::CloseHandle(instance_mutex);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void MainThread::Init()
|
||||
{
|
||||
nbase::ThreadManager::RegisterThread(kThreadUI);
|
||||
|
||||
std::wstring module_dir = nbase::win32::GetCurrentModuleDirectory();
|
||||
ui::GlobalManager::Startup(module_dir + L"resources\\", ui::CreateControlCallback(), false);
|
||||
|
||||
DownloaderForm* form = new DownloaderForm();
|
||||
form->Create(NULL, DownloaderForm::kClassName.c_str(), WS_OVERLAPPEDWINDOW & ~WS_MAXIMIZEBOX, 0);
|
||||
form->CenterWindow();
|
||||
form->ShowWindow();
|
||||
}
|
||||
|
||||
void MainThread::Cleanup()
|
||||
{
|
||||
ui::GlobalManager::Shutdown();
|
||||
SetThreadWasQuitProperly(true);
|
||||
nbase::ThreadManager::UnregisterThread();
|
||||
}
|
||||
Reference in new issue
Block a user