[CmdPal] Prevent maximizing (#39220)
Some checks failed
Spell checking / Check Spelling (push) Has been cancelled
Spell checking / Update PR (push) Has been cancelled
Spell checking / Report (Push) (push) Has been cancelled
Spell checking / Report (PR) (push) Has been cancelled

Prevent CmdPal window from maximizing when user double-click the title bar area.

 Closes: #39096
This commit is contained in:
Davide Giacometti
2025-05-04 13:04:29 +02:00
committed by GitHub
parent 8ce198a47b
commit 2ac464279a
2 changed files with 6 additions and 6 deletions

View File

@@ -404,11 +404,6 @@ public sealed partial class MainWindow : Window,
// know till the message is being handled.
WeakReferenceMessenger.Default.Send<HotkeySummonMessage>(new(commandId, _hwnd));
#pragma warning disable SA1310 // Field names should not contain underscore
private const uint DOT_KEY = 0xBE;
private const uint WM_HOTKEY = 0x0312;
#pragma warning restore SA1310 // Field names should not contain underscore
private void UnregisterHotkeys()
{
_keyboardListener.ClearHotkeys();
@@ -502,7 +497,10 @@ public sealed partial class MainWindow : Window,
{
switch (uMsg)
{
case WM_HOTKEY:
// Prevent the window from maximizing when double-clicking the title bar area
case PInvoke.WM_NCLBUTTONDBLCLK:
return (LRESULT)IntPtr.Zero;
case PInvoke.WM_HOTKEY:
{
var hotkeyIndex = (int)wParam.Value;
if (hotkeyIndex < _hotkeys.Count)

View File

@@ -25,6 +25,8 @@ SHCreateStreamOnFileEx
CoAllowSetForegroundWindow
SHCreateStreamOnFileEx
SHLoadIndirectString
WM_HOTKEY
WM_NCLBUTTONDBLCLK
Shell_NotifyIcon
LoadIcon