How To Embed Manifest File Into Qt 4.8.5 Executable

There are two ways to control High DPI Scaling for your Qt 4.8.5 compiled Windows executable:

– 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’t want to deal with it.

OR

– 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.

1. Create a basic text file with this EXACT content and save as your-exe-name.exe.manifest in your project folder.


<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
 <application>
  <windowsSettings>
   <dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
   <dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2</dpiAwareness>
  </windowsSettings>
 </application>
</assembly>

Continue reading “How To Embed Manifest File Into Qt 4.8.5 Executable”

How to use Windows API all-purpose PVOID* structure

If you’re into modern Windows API c++ programming, it seems things have gotten just slightly easier. Naming conventions for classes, functions, structs, enums, etc. just aren’t as confusing anymore. I’m sure technical experts know how to move virtual memory around, which is essentially what programming and problem solving is, but if you’re just sitting down for some casual tinkering, it’s going to be a nightmare. You’re relying on the developers before you to name things intuitively.

So now Windows API documentation has been trying to promote using their generic PVOID struct more. It’s safer, maybe. It’s nothing special. It’s a generic struct to get a pointer to some data, any data. But you have to cast the data type yourself.

Here’s an example of how you can do something: Continue reading “How to use Windows API all-purpose PVOID* structure”

Hello World with QPainter

This is the most basic of basic tutorials when it comes to computer programming. It is virtually done to death. The basic idea is for you as the programmer to be able to send a message to the computer and have it return the message to you as output. Originally, this would be done via command-line or command-prompt, a scary black void of an interface. So in this case, I’ll show you how to actually engage the user by hooking into the default GUI mainWindow. Continue reading “Hello World with QPainter”