Home > Software engineering >  Support Windows 11 Snap Layout in WPF app
Support Windows 11 Snap Layout in WPF app

Time:11-03

I want to enable SnapLayout for WPF. Because I use Customized Window, according to the enter image description here

CodePudding user response:

Mark the WM_NCLBUTTONDOWN message as handled. This prevents the classic button from showing.

case InteropValues.WM_NCLBUTTONDOWN:
     handled = true;
     break;

Handle various WM_NC* mouse messages and using SendMessage to send related messages to the Window to mimic "client area" mouse messages with translated POINT values so that WPF can receive them.

  • Related