Skip to content

Commit

Permalink
Fix "Caption Resize" issue
Browse files Browse the repository at this point in the history
  • Loading branch information
shatyuka committed Apr 4, 2024
1 parent fb042f5 commit c1425bd
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions CollapseLauncher/XAMLs/MainApp/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -300,14 +300,19 @@ private IntPtr WndProc(IntPtr hwnd, uint msg, UIntPtr wParam, IntPtr lParam)
}
case WM_NCHITTEST:
{
// Fix "Ghost Minimize Button" issue
const int HTCLIENT = 1;
const int HTCAPTION = 2;
const int HTMINBUTTON = 8;
const int HTMAXBUTTON = 9;
const int HTCLOSE = 20;
const int HTTOP = 12;

var result = CallWindowProc(m_oldWndProc, hwnd, msg, wParam, lParam);
if (result is HTMINBUTTON or HTMAXBUTTON or HTCLOSE) return HTCLIENT;

// Fix "Ghost Minimize Button" issue
if (result == HTMINBUTTON) return HTCLIENT;

// Fix "Caption Resize" issue
if (result == HTTOP) return HTCAPTION;

return result;
}
}
Expand Down

0 comments on commit c1425bd

Please sign in to comment.