Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How does one call Win32 API functions from XBasic?

API functions Win32 xbasic
0
10 Posted

How does one call Win32 API functions from XBasic?

0
10

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.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123