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.
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.
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.
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.
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.
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.
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 […]
Qt is a cross-platform framework that encapsulates API across many Operating Systems but one always faces situations in which he/she needs to access and use OS specific capabilities. Windows API is a massive collection of interfaces that allow a programmer to use and include Windows features in their programs. Below is a simple example on […]
I use the function below to get the version of my Windows applications and show it on the title bar or about page programmatically. It uses Win32 API so it is not cross-platform.
I use the code from the following article to allow only a single instance of my programs (mostly written using Qt Framework) to run on Windows. Some programs (specially the ones which connect to a specific type of hardware or resource) need this limitation to avoid conflicts. Please also note that this code is specific […]