{"id":533,"date":"2026-05-08T13:05:04","date_gmt":"2026-05-08T19:05:04","guid":{"rendered":"https:\/\/eastfist.com\/qt_tutorials\/?p=533"},"modified":"2026-05-08T13:49:03","modified_gmt":"2026-05-08T19:49:03","slug":"how-to-embed-manifest-file-into-qt-4-8-5-executable","status":"publish","type":"post","link":"https:\/\/eastfist.com\/qt_tutorials\/how-to-embed-manifest-file-into-qt-4-8-5-executable\/","title":{"rendered":"How To Embed Manifest File Into Qt 4.8.5 Executable"},"content":{"rendered":"<p>There are two ways to control High DPI Scaling for your Qt 4.8.5 compiled Windows executable:<\/p>\n<p>&#8211; Manually set High DPI Scaling via right-clicking on your Windows executable and changing it in the Compatibility tab. However, this modifies the Windows Registry. And we don&#8217;t want to deal with it.<\/p>\n<p>OR<\/p>\n<p>&#8211; Embed an XML .manifest file into the Windows executable itself so that it is always reliably set every time the program is run. And if the user moves the executable to another location, it will still run with our intended high dpi scaling settings.<\/p>\n<h4>1. Create a basic text file with this EXACT content and save as <strong><em>your-exe-name.exe.manifest<\/em><\/strong> in your project folder.<\/h4>\n<p><code><br \/>\n&#x3C;?xml version=&#x22;1.0&#x22; encoding=&#x22;UTF-8&#x22; standalone=&#x22;yes&#x22; ?&#x3E;<br \/>\n&#x3C;assembly xmlns=&#x22;urn:schemas-microsoft-com:asm.v1&#x22; manifestVersion=&#x22;1.0&#x22; xmlns:asmv3=&#x22;urn:schemas-microsoft-com:asm.v3&#x22;&#x3E;<br \/>\n  &emsp;&#x3C;application&#x3E;<br \/>\n    &emsp;&emsp;&#x3C;windowsSettings&#x3E;<br \/>\n      &emsp;&emsp;&emsp;&#x3C;dpiAware xmlns=&#x22;http:\/\/schemas.microsoft.com\/SMI\/2005\/WindowsSettings&#x22;&#x3E;true&#x3C;\/dpiAware&#x3E;<br \/>\n      &emsp;&emsp;&emsp;&#x3C;dpiAwareness xmlns=&#x22;http:\/\/schemas.microsoft.com\/SMI\/2016\/WindowsSettings&#x22;&#x3E;PerMonitorV2&#x3C;\/dpiAwareness&#x3E;<br \/>\n    &emsp;&emsp;&#x3C;\/windowsSettings&#x3E;<br \/>\n  &emsp;&#x3C;\/application&#x3E;<br \/>\n&#x3C;\/assembly&#x3E;<br \/>\n<\/code><br \/>\n<!--more--><\/p>\n<h4>2. Create a basic text file with this content and save as <strong><em>resource.rc<\/em><\/strong> in your project folder.<\/h4>\n<p><code><br \/>\n#include &#x3C;windows.h&#x3E;<br \/>\nCREATEPROCESS_MANIFEST_RESOURCE_ID    RT_MANIFEST    &#x22;your-exe-name.exe.manifest&#x22;<br \/>\n...<br \/>\n1 VERSIONINFO<br \/>\n...<br \/>\n<\/code><\/p>\n<h4>3. Add this to your Qt project&#8217;s .pro file<\/h4>\n<p><code><br \/>\nQT += core gui opengl svg<br \/>\n...<br \/>\n#remove Qt default embedded manifest<br \/>\nwin32 {<br \/>\n    &emsp;CONFIG -= embed_manifest_exe<br \/>\n}<\/p>\n<p>RC_FILE = resource.rc<br \/>\n<\/code><\/p>\n<h4>4. Compile.<\/h4>\n<p>If everything worked out correctly, you can use a free program called <a href=\"https:\/\/www.angusj.com\/resourcehacker\/\" target=\"_blank\">Resource Hacker<\/a>, that can read and edit Windows executable embedded resources like icons and manifest, to check your Qt compiled executable has an embedded manifest file. If so, then you can run the executable to see if it renders correctly. Good luck!<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/eastfist.com\/qt_tutorials\/wp-content\/uploads\/2026\/05\/highdipscalingWrong.png\" alt=\"\" width=\"300\" height=\"225\" \/> Incorrect high dpi scaling in fullscreen mode<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/eastfist.com\/qt_tutorials\/wp-content\/uploads\/2026\/05\/highdipscalingCorrect.png\" alt=\"\" width=\"300\" height=\"225\" \/><br \/>\nCorrect high dpi scaling in fullscreen mode<\/p>\n<p>For reference, here was <a href=\"https:\/\/eastfist.com\/qt_tutorials\/fixing-windows-10-aspect-ratio-scaling-problem-for-lower-resolution-display\/\">my initial solution<\/a> for the same problem back on my Windows 10 machine. I was using the right-click executable compatibility properties high dpi scaling settings, which only affects that local executable using a registry key. It would explain why the effect didn&#8217;t work on my new Windows 11 machine. Noob issues. LOL. Anyway, the more effective way is to embed the manifest, folks.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>There are two ways to control High DPI Scaling for your Qt 4.8.5 compiled Windows executable: &#8211; Manually set High DPI Scaling via right-clicking on your Windows executable and changing it in the Compatibility tab. However, this modifies the Windows Registry. And we don&#8217;t want to deal with it. OR &#8211; Embed an XML .manifest &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/eastfist.com\/qt_tutorials\/how-to-embed-manifest-file-into-qt-4-8-5-executable\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;How To Embed Manifest File Into Qt 4.8.5 Executable&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[27],"tags":[187,182,179,180,186,183,181,185,23,184],"class_list":["post-533","post","type-post","status-publish","format-standard","hentry","category-qt-2","tag-dpiaware","tag-embed","tag-exe","tag-executable","tag-high-dpi-scaling","tag-manfiest","tag-pe","tag-resource-hacker","tag-windows","tag-xml"],"_links":{"self":[{"href":"https:\/\/eastfist.com\/qt_tutorials\/wp-json\/wp\/v2\/posts\/533","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/eastfist.com\/qt_tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/eastfist.com\/qt_tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/eastfist.com\/qt_tutorials\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/eastfist.com\/qt_tutorials\/wp-json\/wp\/v2\/comments?post=533"}],"version-history":[{"count":34,"href":"https:\/\/eastfist.com\/qt_tutorials\/wp-json\/wp\/v2\/posts\/533\/revisions"}],"predecessor-version":[{"id":569,"href":"https:\/\/eastfist.com\/qt_tutorials\/wp-json\/wp\/v2\/posts\/533\/revisions\/569"}],"wp:attachment":[{"href":"https:\/\/eastfist.com\/qt_tutorials\/wp-json\/wp\/v2\/media?parent=533"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/eastfist.com\/qt_tutorials\/wp-json\/wp\/v2\/categories?post=533"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/eastfist.com\/qt_tutorials\/wp-json\/wp\/v2\/tags?post=533"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}