Rounded Corners on Windows 11 |
Post Reply |
Author | |
cpede
Senior Member Joined: 13 August 2004 Location: Denmark Status: Offline Points: 668 |
Post Options
Thanks(0)
Posted: 08 October 2021 at 5:43am |
How do we get rounded windows corners on Windows 11 using the Office themes?
|
|
Product: Xtreme ToolkitPro (24.0.0)
Platform: Windows 10 (x64) Language: Visual Studio 2017 (C++) |
|
dbrookes
Groupie Joined: 30 August 2019 Location: Australia Status: Offline Points: 70 |
Post Options
Thanks(0)
|
Windows 11 won't enable it by default when the application is drawing its own window frame. They talk a little bit about it here https://docs.microsoft.com/en-us/windows/apps/desktop/modernize/apply-rounded-corners and how to force enable it using dwmapi. I've tested forcing rounded corners with XTP frame hook theming and it seems to work okay. Here is a sample I have tested with:
One thing you'll need to do with XTP frame hook is disable XTP's frame shadows as they won't work correctly with the rounded corners, as you'd probably expect. If that set window attribute function succeeds you should call pCommandBars->GetFrameHook()->DisableShadows(). Your window should then be using the built-in system shadows instead (at least ours seems to).
|
|
Pesci7
Groupie Joined: 27 January 2021 Location: Italy Status: Offline Points: 17 |
Post Options
Thanks(0)
|
Thanks, another great contribute. It works on the main window and also on the splash screen. Is it possible to have rounded corner also on context menu? The drawback is that we have again the problem of catching the border of the window for resizing.
|
|
Product: Xtreme ToolkitPro (22.1.0)
Platform: Windows 11 (x64) Language: Visual Studio 2022 (C++) |
|
cpede
Senior Member Joined: 13 August 2004 Location: Denmark Status: Offline Points: 668 |
Post Options
Thanks(0)
|
Thanks for posting, and I can add this for more info:
But, this probably only works when?
And in my attempt to use DWM, I got this funny looking drawing error, cutting the top of the full page backstage back arrow, using the Office 2016 themes: (corrected: maybe it is drawing white on white, why it looks clipped?) Will CodeJock need to implement the rounded corners in the themes directly? PS, also notice the new https://docs.microsoft.com/en-us/windows/apps/desktop/modernize/apply-snap-layout-menu Windows 11 feature, that probably also needs to be implemented into the themes? |
|
Product: Xtreme ToolkitPro (24.0.0)
Platform: Windows 10 (x64) Language: Visual Studio 2017 (C++) |
|
dbrookes
Groupie Joined: 30 August 2019 Location: Australia Status: Offline Points: 70 |
Post Options
Thanks(0)
|
I have m_bAllowDwm set to FALSE by the looks of it (its been like that for years). It looks like the Office 2013/2016 frame theme automatically turns it off anyway. Maybe try it on the ribbon sample and see what happens. I've not noticed issues yet. About the snap menu layout. I looked at this as well. That works okay with XTP's frame hook if you are using menu bar + toolbars since XTP handles WM_NCHITTEST there. However, if you are using a ribbon bar the maximize button (and others) are part of the ribbon bar itself which is not in the non client area, therefore no WM_NCHITTEST. You just have to press the shortcut to get to it (Win + Z).
|
|
SueDowell
Newbie Joined: 26 October 2021 Location: USA Status: Offline Points: 1 |
Post Options
Thanks(0)
|
Can you please tell me what you think of Windows 11? Is it good or the usual?)
|
|
dbrookes
Groupie Joined: 30 August 2019 Location: Australia Status: Offline Points: 70 |
Post Options
Thanks(0)
|
Its fine I guess. It had a lot of bugs on release but they've been ironing them out. Its more or less just a reskin of Windows 10 with some extra features like WSLG. They didn't even increment the NT version which is surprising.
|
|
rdhd
Senior Member Joined: 13 August 2007 Location: United States Status: Offline Points: 891 |
Post Options
Thanks(0)
|
Unfortunately it is really tough to resize our app if shadows is off. At least on my 4k monitor. I spend a lot of time trying to get the resize cursor icon to show up and not go away when I press the mouse button. Probably my achy shaky hand.
|
|
rdhd
Senior Member Joined: 13 August 2007 Location: United States Status: Offline Points: 891 |
Post Options
Thanks(0)
|
Hi cepde, I totally missed the XTP_ID_RIBBONBACKSTAGE_BACK and implemented my own "Back" button. So I just called to add that command to my backstage and then to set the control to manual update and enabled it. Worked fine. But, I have no tooltip string or image. Did you create your own image and add it to the image manager? When I added the command, the toolkit pro DLL was the main resource handle. No string there so CJ just went the whole MFC route to find a string (none found on my box, which wouldn't have been correct in any case). Does CJ have its own icon? We provide our own translations so the image is my only impediment to using the CJ "Back" command.
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |