@WINAPI[module,function[,integer | PINT=n | PLONG=n | PDWORD=n | NULL | BUFFER | "string"]] : Returns the result of calling a Windows API function. The arguments are:

 

module - name of the DLL containing the function

 

function - function name (case sensitive)

 

integer - an integer value to pass to the function

 

PINT - a pointer to the integer n

 

PLONG - a pointer to the long integer n

 

PDWORD - a pointer to the DWORD n

 

PINT64 - a pointer to a 64-bit integer

 

NULL - a null pointer (0)

 

BUFFER - @WINAPI will pass an address for an internal buffer for the API to return a Unicode string value.

 

aBUFFER - @WINAPI will pass an address for an internal buffer for the API to return an ASCII string value.

 

"string" - text argument (this must be enclosed in double quotes). If the argument is preceded by an 'a' (i.e.,  a"Argument") then it is converted from Unicode to ASCII before calling the API. (Some Windows APIs only accept  ASCII arguments.)

 

@WINAPI supports a maximum of 8 arguments. The return value is either a string value returned by the API (if BUFFER or aBUFFER is specified), or the integer value returned by the API. The function must be defined as WINAPI (__stdcall). If @WINAPI can't find the specified function, it will append a "W" (for the Unicode version) to the function name and try again.

 

See also @CAPI.