How does one call Win32 API functions from XBasic?
The functions for Win32 are declared in user32.dec, gdi32.dec, kernel32.dec, and shell32.dec. Each .dec file corresponds to a Windows dynamic link library (.dll) file that exports the various API functions: user32.dll, gdi32.dll, kernel32.dll, and shell32.dll. In order to use an API function, you first need to know which dll library the function is included in. For example, the function Rectangle (hdc, x, y, w, h) is in gdi32.dll and is listed in gdi32.dec. In order to use this function, you must IMPORT the gdi32.dll library using the IMPORT statement in the beginning of your PROLOG: IMPORT “gdi32” Once imported, all the functions in the dll are available to use just like any other XBasic function. See the example program api.x. The *.dec files to not list EVERY available Win32 API function call. If the function you wish to use is not shown in the appropriate *.dec file, then simply add it to the *.dec file.