FX GUI embed: WS_EX_TOOLWINDOW + no minimize box for offscreen window (no stray taskbar button that cannot be restored)
This commit is contained in:
@@ -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; }
|
||||
|
||||
Reference in New Issue
Block a user