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.
There are many APIs on the web that accept JSON requests and reply using JSON. An example for this can be most of Google’s API services. For example if you are writing a Qt application that needs JSON interaction with a Google API (such as Google Webmaster API) you can easily send requests and receive […]
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.
Qt allows you to use Java code in your Android applications. This is the same code that Android Studio (or Eclipse etc.) users use when they are writing applications for Android. In Qt, by default, you are limited to C++ code and what the Qt modules have to offer (which in most cases are enough) but there […]
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 […]
I use the following method to make an application remain on top of other windows in Qt: SetWindowPos ( (HWND)winId(), HWND_TOPMOST, window_top_pos, window_left_pos, window_width, window_height, SWP_SHOWWINDOW ); Note that window_top_pos, window_left_pos, window_width and window_height are variables and you can replace them with your own. Please be aware that this is a Win32 API function so […]