Skip to content

Commit

Permalink
Remove WS_EX_TOPMOST ExStyle for Direct3D9
Browse files Browse the repository at this point in the history
  • Loading branch information
elishacloud committed Jul 29, 2024
1 parent efe1dc3 commit 6afeefa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Dllmain/BuildNo.rc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#define BUILD_NUMBER 7073
#define BUILD_NUMBER 7074
10 changes: 5 additions & 5 deletions d3d9/IDirect3D9Ex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -492,17 +492,17 @@ void UpdatePresentParameter(D3DPRESENT_PARAMETERS* pPresentationParameters, HWND
Utils::CheckMessageQueue(DeviceDetails.DeviceWindow);
}

// Remove tool window
// Remove tool and topmost window
if (DeviceDetails.DeviceWindow != LastDeviceWindow)
{
LONG lExStyle = GetWindowLong(DeviceDetails.DeviceWindow, GWL_EXSTYLE);

if (lExStyle & WS_EX_TOOLWINDOW)
if (lExStyle & (WS_EX_TOOLWINDOW | WS_EX_TOPMOST))
{
LOG_LIMIT(3, __FUNCTION__ << " Removing window WS_EX_TOOLWINDOW!");
LOG_LIMIT(3, __FUNCTION__ << " Removing window" << ((lExStyle & WS_EX_TOOLWINDOW) ? " WS_EX_TOOLWINDOW" : "") << ((lExStyle & WS_EX_TOPMOST) ? " WS_EX_TOPMOST" : ""));

SetWindowLong(DeviceDetails.DeviceWindow, GWL_EXSTYLE, lExStyle & ~WS_EX_TOOLWINDOW);
SetWindowPos(DeviceDetails.DeviceWindow, ((lExStyle & WS_EX_TOPMOST) ? HWND_TOPMOST : HWND_TOP), 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED);
SetWindowLong(DeviceDetails.DeviceWindow, GWL_EXSTYLE, lExStyle & ~(WS_EX_TOOLWINDOW | WS_EX_TOPMOST));
SetWindowPos(DeviceDetails.DeviceWindow, ((lExStyle & WS_EX_TOPMOST) ? HWND_NOTOPMOST : HWND_TOP), 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED);
}
}

Expand Down

0 comments on commit 6afeefa

Please sign in to comment.