mirror of
https://github.com/microsoft/PowerToys
synced 2025-08-30 14:07:42 +00:00
[CmdPal] Prevent maximizing (#39220)
Prevent CmdPal window from maximizing when user double-click the title bar area. Closes: #39096
This commit is contained in:
committed by
GitHub
parent
8ce198a47b
commit
2ac464279a
@@ -404,11 +404,6 @@ public sealed partial class MainWindow : Window,
|
|||||||
// know till the message is being handled.
|
// know till the message is being handled.
|
||||||
WeakReferenceMessenger.Default.Send<HotkeySummonMessage>(new(commandId, _hwnd));
|
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()
|
private void UnregisterHotkeys()
|
||||||
{
|
{
|
||||||
_keyboardListener.ClearHotkeys();
|
_keyboardListener.ClearHotkeys();
|
||||||
@@ -502,7 +497,10 @@ public sealed partial class MainWindow : Window,
|
|||||||
{
|
{
|
||||||
switch (uMsg)
|
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;
|
var hotkeyIndex = (int)wParam.Value;
|
||||||
if (hotkeyIndex < _hotkeys.Count)
|
if (hotkeyIndex < _hotkeys.Count)
|
||||||
|
@@ -25,6 +25,8 @@ SHCreateStreamOnFileEx
|
|||||||
CoAllowSetForegroundWindow
|
CoAllowSetForegroundWindow
|
||||||
SHCreateStreamOnFileEx
|
SHCreateStreamOnFileEx
|
||||||
SHLoadIndirectString
|
SHLoadIndirectString
|
||||||
|
WM_HOTKEY
|
||||||
|
WM_NCLBUTTONDBLCLK
|
||||||
|
|
||||||
Shell_NotifyIcon
|
Shell_NotifyIcon
|
||||||
LoadIcon
|
LoadIcon
|
||||||
|
Reference in New Issue
Block a user