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 how to use Windows API in Qt.
Let’s say we want to use GetSystemTime function in our Qt program. Searching Google for “GetSystemTime API” you’ll get the API Documentation from MSDN website. Parameters and return type values should be obvious:
How to get version number of an EXE file in Qt (Using Win32 API)
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.
Continue reading “How to get version number of an EXE file in Qt (Using Win32 API)”
How to limit 32-bit applications to one instance in Visual C++ (with or without Qt)
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 to Windows.
Get EXE version using Windows API in Qt
This function can be used to get an EXE file version. I use this class in almost all of my programs to add EXE version to Main window title.
Continue reading “Get EXE version using Windows API in Qt”