Windows 11 round corners and non native title bar?

Is it possible to get the windows 11 round corners on a juce standalone application window and not use the native title bar?
setUsingNativeTitleBar(false);

Found the solution in this forum post:

Here is an up-to-date version of that solution:

In your mainWindow component, add this at the top:

#if JUCE_WINDOWS || JUCE_MAC
	extern void setRoundedCorners ( void*, bool );
#endif

And in your mainWindow component then add this:

#if JUCE_WINDOWS || JUCE_MAC
	void parentHierarchyChanged () override
	{
		juce::DocumentWindow::parentHierarchyChanged ();

		if ( auto peer = getPeer () )
			setRoundedCorners ( peer->getNativeHandle (), ! isUsingNativeTitleBar () );
	}
#endif

Main_MacHelper.mm (181 Bytes)
Main_WinHelper.cpp (1.1 KB)

3 Likes

Is there a way to make this work for standalone plugins?

1 Like

I guess you need to customise the Standalone plugin wrapper window.

1 Like