[3.0] fix build with gcc12/11 on mingw64
- Backport some contrib patches from 4.0
- fix qt build when Win10 is the default (UCRT builds)
- always default to WinXP in msvcrt builds (it was using the toolchain default which is not XP anymore in recent mingw64)
- fix d3d11 header building by depending on the mingw64 headers (the system .idl are not in constant places but these are)