The entire set of Windows functions which can be accessed by applications is typically called the application programming interface, usually shortened to just API.
Declare
PowerBASIC applications use the API by simply adding a line of code which tells
the compiler which API function to use. The line of code looks like this:
DECLARE Function MyFunc LIB "user.dll" ALIAS "MyFunctA" (x as Long) AS Long
The Windows installation files typically hold many API functions, so the Declare function must not only tell the file name, but the function name as well. Also, each function has a unique list of arguments that must be specified in the Declare statement.
Win32API.inc
PowerBASIC makes it easy to use API by installing the "Win32API.inc" text file,
which simply has the Declare statements for many of the most useful Windows API.
The file is updated regularly and can be downloaded from the PowerBASIC home page.
To use the Declare statement found within Win32API.inc, a PowerBASIC program must include the following compiler directive.
#INCLUDE "Win32API.inc"
The full path name of the file is not required, since the compiler knows where the file was installed by PowerBASIC.
Which API To Use?
There simply isn't a single list of all API a PowerBASIC programmer will find useful.
The PowerBASIC sample applications provide some examples, and there is sample code in the
PowerBASIC forums. But there is no systematic, categorized listing of PowerBASIC source
code for useful API.
Most programmers collect such code one API at a time as they write application requiring features offerred by Windows API.
Declare Syntax
PowerBASIC applications use the API by simply adding a line of code which tells
the compiler which API function to use. The line of code looks like this:
DECLARE FUNCTION ProcName LIB "LibName" ALIAS "AliasName" (arguments) AS type
If you have any suggestions or corrections, please let me know.