How to know whether the snap applied in windows 11 windows. Is there any API.

visi venkat 1 Reputation point
2022-04-26T04:51:23.56+00:00

Is there a method or any API to tell if snap is enabled or disabled in Windows 11? Please answer if there is any other way.

Developer technologies | Windows Presentation Foundation
Windows for business | Windows Client for IT Pros | User experience | Other
Developer technologies | XAML
Developer technologies | C#
{count} votes

3 answers

Sort by: Most helpful
  1. Castorix31 90,686 Reputation points
    2022-04-27T07:17:11.28+00:00

    On Windows 10, it works with
    SystemParametersInfo and SPI_GETWINARRANGING
    So it should work on Windows 11 too...

    0 comments No comments

  2. Limitless Technology 39,931 Reputation points
    2022-04-27T08:52:11.037+00:00

    Hi there,

    Currently, there is no API or Powershell command to find if the snap is enabled or disabled in Windows 11. If the app's window has the maximize caption button available, the system will automatically show snap layouts when a user hovers the mouse over the window's maximize button.

    If your app's main window has the maximize caption button available but does not show snap layouts, it may be because you've customized your caption buttons or title bar in a way that prevents it.

    Support snap layouts for desktop apps on Windows 11 https://learn.microsoft.com/en-us/windows/apps/desktop/modernize/apply-snap-layout-menu

    ---------------------------------------------------------------------------------------------------------------------------------------

    --If the reply is helpful, please Upvote and Accept it as an answer–


  3. Stoomkracht 0 Reputation points
    2025-01-25T12:45:29.7266667+00:00

    No, Microsoft does not seem to want to offer any win32 API for any new introduced Windows functionalies. Can't query snap state, can't programmatically snap a specific window to a specific location. Can't pin/unpin from taskbar. Can't move a window to a specific virtual desktop or manage them, can't reliable figure out the visibility or actual size of a window. It is a mess. And IF they introduce an API, it is c++ only. No flat c style api. They use private api's internally. How different from the past... although back then they also hid some specific stuff for others to put competition at a disadvantage. Now they do not even care anymore to support third party utilities.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.