1
0
mirror of https://github.com/narzoul/DDrawCompat synced 2024-12-30 08:55:36 +01:00

Detect window creation on WM_NCCREATE

Fixes invisble network detection window in Empire Earth NeoEE (issue #251).
This commit is contained in:
narzoul 2024-06-30 23:20:25 +02:00
parent 0ce906c28c
commit 6d840907c3
2 changed files with 12 additions and 3 deletions

View File

@ -184,9 +184,15 @@ namespace
if (std::string(className) == "CompatWindowDesktopReplacement") if (std::string(className) == "CompatWindowDesktopReplacement")
{ {
// Disable VirtualizeDesktopPainting shim // Disable VirtualizeDesktopPainting shim
return 0; return FALSE;
} }
return origDefWindowProc(hwnd, msg, wParam, lParam);
LRESULT result = origDefWindowProc(hwnd, msg, wParam, lParam);
if (result)
{
Gdi::WinProc::onCreateWindow(hwnd);
}
return result;
} }
case WM_NCLBUTTONDOWN: case WM_NCLBUTTONDOWN:
@ -559,7 +565,8 @@ namespace
{ {
LOG_FUNC(procName.c_str(), Compat::WindowMessageStruct(hwnd, uMsg, wParam, lParam)); LOG_FUNC(procName.c_str(), Compat::WindowMessageStruct(hwnd, uMsg, wParam, lParam));
LRESULT result = wndProcHook(hwnd, uMsg, wParam, lParam, oldWndProcTrampoline); LRESULT result = wndProcHook(hwnd, uMsg, wParam, lParam, oldWndProcTrampoline);
if (WM_CREATE == uMsg && -1 != result) if (WM_CREATE == uMsg && -1 != result ||
WM_NCCREATE == uMsg && result)
{ {
Gdi::WinProc::onCreateWindow(hwnd); Gdi::WinProc::onCreateWindow(hwnd);
} }

View File

@ -404,6 +404,7 @@ namespace Gdi
std::vector<LayeredWindow> getVisibleLayeredWindows() std::vector<LayeredWindow> getVisibleLayeredWindows()
{ {
D3dDdi::ScopedCriticalSection lock;
std::vector<LayeredWindow> layeredWindows; std::vector<LayeredWindow> layeredWindows;
for (auto it = g_windowZOrder.rbegin(); it != g_windowZOrder.rend(); ++it) for (auto it = g_windowZOrder.rbegin(); it != g_windowZOrder.rend(); ++it)
{ {
@ -425,6 +426,7 @@ namespace Gdi
std::vector<LayeredWindow> getVisibleOverlayWindows() std::vector<LayeredWindow> getVisibleOverlayWindows()
{ {
D3dDdi::ScopedCriticalSection lock;
std::vector<LayeredWindow> layeredWindows; std::vector<LayeredWindow> layeredWindows;
RECT wr = {}; RECT wr = {};
auto statsWindow = GuiThread::getStatsWindow(); auto statsWindow = GuiThread::getStatsWindow();