Code signing is one of the most popular ways of confirming the integrity of software packages. This is made possible by the author of the PE (such as *exe, *.dll and so on) using a Sign tool to add their signature (a certificate) to the PE file. Checking the signature of PE files on the other hand can be done by using WinVerifyTrust function. This example demonstrates how WinVerifyTrust can be used. In this post I’ll share the slight changes needed to make WinVerifyTrust work with Qt Framework, along with a tool built with Qt Framework, that can be used to verify the signature of all PE files within a chosen folder.
Continue reading “SignReport, a Tool for Batch Verification of PE Signatures”How to Use DPAPI with Qt Framework to Encrypt and Decrypt Data
When dealing with data encryption and decryption in Windows operating systems, probably one of the best choices is to use the Data Protection API. In this post I’ll be sharing two simple functions that can be used to encrypt and decrypt data (such as passwords, recovery keys and so on) that you want to store in an easy, quick and highly protected manner. Needless to say, these functions can be used with C++ and Qt Framework.
Continue reading “How to Use DPAPI with Qt Framework to Encrypt and Decrypt Data”How to Access Windows Event Log Using C++ with Qt and Win32 API
In this post I’ll share a method you can use to access and read events in Windows operating system, using C++. Note that this method is modified to be used with Qt, but you can easily replace the few Qt classes used in this example and remove the dependency on Qt if you are using any other frameworks. In any case, this method relies on Win32 APIs and will work only on Windows operating system.
Continue reading “How to Access Windows Event Log Using C++ with Qt and Win32 API”How to Check if Windows is Locked in Qt/C++
Here is how you can check and see if Windows is locked in Qt/C++. This same function will also let you know if the user is switched to another. Note that this involves using some Win32 API functions.
Continue reading “How to Check if Windows is Locked in Qt/C++”How to Open CHM Files and Topics in C++/Qt (Using Windows API)
In Qt/C++ you can open Compiled HTML Help files (*.CHM files) quite easily with a simple Win32 API function named HtmlHelp. In this post I have shared a wrapper function that you can copy and paste in your Qt/C++ code and use.
Continue reading “How to Open CHM Files and Topics in C++/Qt (Using Windows API)”How to Get Window Handle (HWND) in Qt
You can use the following approach to get a Window‘s Handle in Qt. This can be useful in case you need to call a Windows API (Win32 API) function that is not implemented in Qt or for any other purposes.
Continue reading “How to Get Window Handle (HWND) in Qt”What you need to know about LPCTSTR in Windows API (Specially for Qt users)
This question comes up a lot and is sometimes very confusing but if you just pay attention for a few seconds you’ll get past this forever, I promise you.
Continue reading “What you need to know about LPCTSTR in Windows API (Specially for Qt users)”How to List All Running Programs and Windows in Qt
If you are learning how to use Windows API (specially Win32 API) in Qt you might have come across a lot of functions which require the usage of Callback Functions. A very well-known example is EnumWindows function. This function allows listing all open windows through a callback function.
Continue reading “How to List All Running Programs and Windows in Qt”How To Get Free Disk Space In C++ (Qt for Windows)
You can use the following Win32 API function to get the free disk space in C++. Note that this function can be used with Qt for Windows if you add the required dependencies described in this post.
Continue reading “How To Get Free Disk Space In C++ (Qt for Windows)”How to use System-Wide Hotkeys in your Qt application
First of all, this method can only be used in Windows because it makes use of the RegisterHotKey function which is a Win32 API function. So if you want to trigger a function in your Qt application even when your application is out of focus or minimized or even hidden then follow the steps below one by one:
Continue reading “How to use System-Wide Hotkeys in your Qt application”