Skip to content

Commit

Permalink
intercept SC_MAXIMIZE of WM_SYSCOMMAND to avoid fullscreen mode #499
Browse files Browse the repository at this point in the history
  • Loading branch information
Scighost committed Dec 3, 2023
1 parent 542693a commit abb4ec0
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Starward/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,14 @@ public void ChangeAccentColor(Color? backColor = null, Color? foreColor = null)

public IntPtr SUBCLASSPROC(HWND hWnd, uint uMsg, IntPtr wParam, IntPtr lParam, nuint uIdSubclass, IntPtr dwRefData)
{
if (uMsg == ((uint)User32.WindowMessage.WM_SYSCOMMAND))
{
// SC_MAXIMIZE
if (wParam == 0xF030)
{
return IntPtr.Zero;
}
}
return ComCtl32.DefSubclassProc(hWnd, uMsg, wParam, lParam);
}

Expand Down

0 comments on commit abb4ec0

Please sign in to comment.