How to use the Windows API in MinGW?
Whenever I've done this, I just
#include <windows.h>
and start coding. MinGW comes with a windows.h
file so you don't need to do anything extra.
I occasionally use the Windows API for Qt apps that I build using Qt Creator/MinGW - I just #include
the appropriate Windows SDK header (the headers come with MinGW) and it just works. However, you may need to #define
a few things in order that some API calls are exposed. For example, I recently needed to call SHGetSpecialFolderPath
(found in shlobj.h
) but needed to define _WIN32_IE
to 0x0400
first.