From d3a7a0f793a08d857732a95b971fe0e36c5fdc4d Mon Sep 17 00:00:00 2001 From: locphamtran Date: Tue, 18 Aug 2026 21:35:48 +0700 Subject: [PATCH] FX GUI embed: WS_EX_TOOLWINDOW + no minimize box for offscreen window (no stray taskbar button that cannot be restored) --- native_bridge/src/RenderFxJob.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/native_bridge/src/RenderFxJob.cpp b/native_bridge/src/RenderFxJob.cpp index dcf9092..ca9c28d 100644 --- a/native_bridge/src/RenderFxJob.cpp +++ b/native_bridge/src/RenderFxJob.cpp @@ -961,6 +961,11 @@ static int fxGuiSetup(const std::string& jobPath, Vst3Fx* fx, HWND* hwndOut, // 3. Host window. Embedded mode parks it far off-screen (never steals // focus; still visible to GDI so BitBlt captures real pixels). + // WS_EX_TOOLWINDOW: an off-screen visible window would otherwise sit in + // the taskbar; clicking its button "restores" it to -20000,-20000 and it + // looks minimized/unrestorable. Tool window has no taskbar button. + // WS_MINIMIZEBOX is dropped too (a minimized tool window is hard to get + // back while parked off-screen). WNDCLASSA wc = {}; wc.lpfnWndProc = FxGuiWndProc; wc.hInstance = GetModuleHandleA(nullptr); @@ -968,9 +973,12 @@ static int fxGuiSetup(const std::string& jobPath, Vst3Fx* fx, HWND* hwndOut, RegisterClassA(&wc); const int x = offscreen ? -20000 : CW_USEDEFAULT; const int y = offscreen ? -20000 : CW_USEDEFAULT; - HWND hwnd = CreateWindowExA(0, kFxGuiWndClass, + const DWORD exStyle = offscreen ? WS_EX_TOOLWINDOW : 0; + const DWORD style = (offscreen ? (WS_OVERLAPPEDWINDOW & ~WS_MINIMIZEBOX) : WS_OVERLAPPEDWINDOW) + | WS_VISIBLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS; + HWND hwnd = CreateWindowExA(exStyle, kFxGuiWndClass, (name.empty() ? "VST FX" : name).c_str(), - WS_OVERLAPPEDWINDOW | WS_VISIBLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS, + style, x, y, 800, 600, nullptr, nullptr, GetModuleHandleA(nullptr), nullptr); if (!hwnd) { std::cerr << "[FxGui] create window failed" << std::endl; return 1; }