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.

Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,804 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
11,152 questions
XAML
XAML
A language based on Extensible Markup Language (XML) that enables developers to specify a hierarchy of objects with a set of properties and logic.
824 questions
Windows 11
Windows 11
A Microsoft operating system designed for productivity, creativity, and ease of use.
10,279 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Castorix31 86,406 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,746 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–


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.