I have even seen macros that do nothing at all used in front of functions as a weird type of comment/grouping. The only way to know what it does is either look it up (if a well known library) or back-track to the macro to see what it does (which may call even more macros!). Its perfectly legal to do something like
#define procedure void
procedure foo(int x); //great... its pascal!
or even stuff like
#define nada
nada int wtf(nada int bork); //yep, nothing happened here, but you had to figure it out to know that
5 min in the windows tools is like a crash course in why macros are generally bad (hard to read/hard to follow at best) but you can also learn some clever uses for them (as automatic switches to do different things based off compile time info).
Where there is extra info specified before the function name (apart from the return type), this extra info specifies the conventions for passing arguments and return values between functions and callers. The common ones for MS are __cdecl and __stdcall. These are often part of a macro definition. eg WINAPI is a macro for __stdcall. These are not part of the standard and can vary between compilers. If a function is defined as requiring a specific calling convention (eg for a callback function) then it's definition must also specify the same convention. These conventions specify how parameters are passed to/from the function and who cleans up the stack when the function returns.
I do recall needing __declspec( dllimport ) and __declspec( dllexport ) no declarations that did interfare a (DLL) library. Building the library did require the export and code that did use the library did require the import. It was convenient to use macro in the headers. The macro was given value based on what we were compiling (and empty value on non-MS platforms).
extern "C" is used to prevent linker namespace 'mangling' when interfacing C++ code to non-C++. It specifies that for the specified functions c names are used for linking. A c link name just specifies the name whereas a c++ name also specifies the type of parameters using a lettering system to state how many parameters and to differentiate say double from int, int from int& etc. With a c interface you can't have external function overrides but you can with a C++ interface. See: https://learn.microsoft.com/en-us/cpp/cpp/extern-cpp?view=msvc-170
When running across code that has unfamiliar bits and pieces: spend time poking around the bowels of the interwebz. More often than not using the exact line of code as the search parameter pulls up info sufficient to Lucy 'splain what's going on.
That is what I did with the 2nd and 3rd code snippets. The 3rd was a bit more on-target than the RLAPI search, but I eventually "got there".
When I first started learning C/C++ on my own there were little to no web resources, only books. Self-teaching is so much easier now with multiple websites.
A good tutorial site for C++ that is kept up-to-date is Learn C++: