How to use the Windows API in MinGW?
+4
A:
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.
Greg Hewgill
2009-10-11 18:50:22
It is wrong to tell that MinGW comes with windows.h. People like me, who prefers copying latest packages and building MinGW by yourself (not using installer), should copy w32api package from MinGW download site.
Andrejs Cainikovs
2009-10-11 19:33:15
+1
A:
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.
Rob
2009-10-11 19:16:58