| 17 | | == Creating a Windows GUI application that use the latest Windows visual enhancements (Aero look on Vista/Windows 7 for instance), even if compiled from MinGW/cygwin == |
| | 17 | The trick is to use MinGW as the compiler along with the "-DWINVER=0x500" flag. |
| | 18 | ||=File(s): =||[http://git.libusb.org/?p=libwdi.git;a=blob;f=configure.ac /configure.ac] || |
| | 19 | == Creating a Windows GUI application that use the latest Windows visual enhancements (Aero Glass look on Vista/Windows 7 for instance), even if compiled from MinGW/cygwin == |
| | 20 | The default from all compilers, including Microsoft ones, is NOT to use the default look and feel from each platform, but to force the XP/2k one.[[BR]] |
| | 21 | To enable a more up to date look and feel in standard GUI applications, you need to manually embed the [http://git.libusb.org/?p=libwdi.git;a=blob;f=examples/common_controls.manifest common-controls manifest], as well as include <commctrl.h> in your source. |
| | 22 | * For MSVC projects, just adding the manifest to your resources files in the project will do.[[BR]] |
| | 23 | * For DDK/WDK, as documented [http://jpassing.com/2008/02/01/how-to-use-manifests-with-buildexe here], you need to add an SXS_APPLICATION_MANIFEST line with the name of your manifest |
| | 24 | * For MinGW/cywgin, it's a bit more tricky. What you want to do is link to the manifest in your .rc file, with something like {{{CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "common_controls.manifest"}}}. The problem is that, this needs to appear at the end, else MinGW will ignore it, and you want to be able to edit your .rc in Visual Studio, without destroying the additional data you add to the .rc. The solution is to have the following at the beginning of your .rc |
| | 25 | {{{3 TEXTINCLUDE |
| | 26 | BEGIN |
| | 27 | " |
| | 28 | " |
| | 29 | "// Must reference a manifest for visual styles |
| | 30 | " |
| | 31 | "// Oh, and it must happen at the end, or MinGW will ignore it! |
| | 32 | " |
| | 33 | "#if defined(__GNUC__) |
| | 34 | " |
| | 35 | "CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST ""common_controls.manifest"" |
| | 36 | " |
| | 37 | "#endif |
| | 38 | " |
| | 39 | "" |
| | 40 | END |