Share via

How to programmatically disable snap for a window class

Anonymous
2024-03-05T18:24:53+00:00

I have a MDI application and on Windows11 I have Snap enabled. Works fine with one oddity. If I do not have my application's MDI document maximized, when I move over the maximize button, the Snap window appears. I can click and entry and my application Snaps (not the MDI child window). How can I disable this as I only want the application to snap.

I added a handler for WM_NCHITTEST to my MDI child window but if I don't return HTMAXBUTTON, I get no highlighting on the button and it doesn't react to clicks. Spying on the messages the window gets I don't see anything that I might intercept to prevent Snap from showing up. Well not quite. I do see 0x118 right before Snap shows up which apparently is WM_SYSTIMER though I find nothing in WinUser.h for that message. I'm going to try and just eat that message to see what happens. Seems dangerous to just blindly not process it anytime it shows up.

Windows for home | Windows 10 | Accessibility

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

1 answer

Sort by: Most helpful
  1. DaveM121 891.1K Reputation points Independent Advisor
    2024-03-05T18:59:02+00:00

    Hi, I am Dave, I will help you with this.

    I apologize, Community is just a consumer forum, due to the scope of your question (C++ Dev) can you please post this question to our sister forum on Microsoft Q&A (The Developers Forum) in the C++ section (linked below)

    Over there you will have access to a host of Developers and C++ programming experts and will get a knowledgeable and quick answer to this question.

    https://learn.microsoft.com/en-us/answers/tags/...

    Was this answer helpful?

    0 comments No comments