I am working on the WinUI3 desktop application with C++. I discovered how windows significantly allow us to customize the title bar in this link. But it also said, it will reserve the Top Right/Top Left corner for the Min, Max, and Close buttons which windows will handle.
So as we cannot remove Min, Max, and close button when Window.ExtendsContentIntoTitleBar is set to true , I came across AppWindowTitleBar.ExtendsContentIntoTitleBar Property. By setting AppWindowTitleBar.ExtendsContentIntoTitleBar to true, i was able to remove min max buttons with title bar customization
SetWindowLong(hwnd, GWL_STYLE,GetWindowLong(hwnd, GWL_STYLE) & ~(WS_MINIMIZEBOX | WS_MAXIMIZEBOX));
Here in the above image, I have set Canvas as the Window titlebar, and this canvas has different widgets like textbox, button, etc. But the issue here is, I am not able to perform a mouse click on the titlebar area, I am not able to get a pointer-pressed event, or can't get focus on a textbox on the mouse click, but I'm able to get focus on a textbox on tab press.
It would of great help if you could help me with getting mouse events on the window title bar with window customized with AppWindowTitleBar.ExtendsContentIntoTitleBar.
Thank you
If you add interactive content in the title bar area, you should define explicit drag regions around that content so that users can interact with it.
You could try to use AppWindowTitleBar.SetDragRectangles to set the drag regions.
I suggest you could refer to the Doc: Interactive content