-
Notifications
You must be signed in to change notification settings - Fork 674
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
InputNonClientPointerSource send error message to app window #8976
Comments
I think we can argue that this is a design choice. When you right click on a normal title bar, the system menu is shown. By extending content into title bar, the application draws content there, but that area is still acted like a title bar, so right clicking will have the system menu. If you don't want the system menu to be shown in that case, probably you can catch the message WM_SYSMENU (0x0313) and handle it in your WndProc so that it won't pass through to DefWindowProc. |
感谢您的回复。我尝试通过修改窗口样式,将WS_SYSMENU移除,删除窗口的右键菜单,并在处理了WM_SYSMENU(0x0313)这一消息才完全消除。然而在最早的1.3的版本中,却没有这么多的问题,所以我希望能调查一下这个问题的具体原因。 Thank you for your reply. I tried to remove WS_SYSMENU by modifying the window style, removing the right-click menu from the window, and removing it completely after processing the WM_SYSMENU(0x0313) message. However, in the original 1.3 version, there were not so many problems, so I wanted to investigate the specific cause of this problem. |
@peterjtan Just stopping by to thank you for the LParam seems to be screen coords of the mouse cursor too, so it worked quite nicely in my case where I'm passing client messages to nonclient. |
Describe the bug
When the application meets the following conditions (application window maximization, custom title bar part (ExtendsContentToTitlebar = true), set the drag area of the application window), click the right mouse button of the InputNonClientPointerSource window, and send 0X0313 message to the application window at the same time after triggering the WM_NCRBUTTONDOWN message.
当应用满足以下几个条件(应用窗口最大化,自定义标题栏部分(ExtendsContentToTitlebar = true),设置了应用窗口的拖动区域)时,点击InputNonClientPointerSource窗口的鼠标右键,在触发WM_NCRBUTTONDOWN消息后,并同时给应用窗口发送0X0313消息。
0X0313 message is an unlogged message that is sent to the app window when the app right-clicks the taskbar widget. When the app window adds a window procedure, the message can be captured normally.
0X0313消息是一个未记录的消息,当应用点击任务栏小窗口的右键时,此消息会发送到应用窗口。当应用窗口添加了窗口过程,就可以正常捕捉到该消息。
参考链接:https://blog.csdn.net/davidhsing/article/details/7770909
Reference link:https://blog.csdn.net/davidhsing/article/details/7770909
Steps to reproduce the bug
1.Customize the app title bar
2.Sets the drag area of the app window
3.The app window is maximized
4.Click to drag the right mouse button of the window
Expected behavior
When several of the conditions described above are met, you should not send 0X0313 message to the app window. When this message is handled by default by the app window, the window menu is displayed at the location of the mouse, which should not be displayed under normal circumstances.
满足以上所述的几个条件时,不应该对应用窗口发送0X0313消息。该消息被应用窗口默认处理时,会在鼠标所处的位置处显示窗口菜单,正常情况下该窗口不应该显示。
Screenshots
NuGet package version
Windows App SDK 1.4.1: 1.4.230913002
Packaging type
Packaged (MSIX)
Windows version
Windows 11 version 22H2 (22621, 2022 Update)
IDE
Visual Studio 2022
Additional context
None
The text was updated successfully, but these errors were encountered: