At the same time, this API does not affect compatibility with older versions, and on Windows 7 or earlier versions of Windows, the API will not work and will not cause strange errors.
As a developer, I strongly recommend that you use Microsoft’s official API to implement dark window title bars instead of drawing your own.
This is Microsoft’s document, which describes how to use this API to make Win32 applications support the default dark/light title bar. This is the best way to implement the title bar color to follow the operating system. What’s more, it doesn’t cause errors in older systems (Windows 8/7/Vista/XP).