From d2ef40e0bd27465009e0b6153a60bf9f5b9ef0dd Mon Sep 17 00:00:00 2001 From: Orange Date: Wed, 8 Jul 2026 19:07:31 +0300 Subject: [PATCH] replaced with thread --- examples/example_dx11_hook/dllmain.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/example_dx11_hook/dllmain.cpp b/examples/example_dx11_hook/dllmain.cpp index d9de5bc..dd0c406 100644 --- a/examples/example_dx11_hook/dllmain.cpp +++ b/examples/example_dx11_hook/dllmain.cpp @@ -5,6 +5,7 @@ #include #include #include +#include #include extern IMGUI_IMPL_API LRESULT ImGui_ImplWin32_WndProcHandler(HWND, UINT, WPARAM, LPARAM); @@ -135,9 +136,8 @@ BOOL WINAPI DllMain(const HINSTANCE h_instance, const DWORD reason, LPVOID) if (reason == DLL_PROCESS_ATTACH) { DisableThreadLibraryCalls(h_instance); - CreateThread( - nullptr, 0, - [](LPVOID) -> DWORD + std::thread( + []() { while (!GetModuleHandle("d3d11.dll")) Sleep(100); @@ -147,8 +147,8 @@ BOOL WINAPI DllMain(const HINSTANCE h_instance, const DWORD reason, LPVOID) mgr.set_on_resize_buffers(on_resize_buffers); std::ignore = mgr.hook_dx11(); return 0; - }, - nullptr, 0, nullptr); + }) + .detach(); } else if (reason == DLL_PROCESS_DETACH) {