Sign in Join
Wiki copytemporary

Windows API units

(Windows only)

Note: this article probably will need to be updated to reflect the current (FPC 2.7.1) situation. Also, it apparently was called RTL - does another article called RTL need to be added/substituted? BigChimp, October 2012

Under windows (win32/win64/wince) one can access the Windows API via several Windows API units. This article will try to sketch an overview of what is available in FPC. Lazarus of course also supports Windows APIs (e.g. to show dialogs) which is not covered here.

In general this page will describe the status as of FPC 2.2.1+, and only detail the earlier situation when it is needed for the understanding of the current structure.

Organization

The Windows API units have been redivided over directories/packages several times, currently the situation is as follows:

In older versions, both winunits packages were merged in one package (base/winunits or extra/winunits, depending on FPC version). In older versions more windows units were present in the RTL directory. This has now been reduced to the ones that the RTL actually has dependencies on.

Reducing the Windows unit

In the past, before winunits-base existed, most missing API symbols were added to unit windows. Currently efforts are underway to remove these symbols and put them in the unit where Delphi puts them (comdlg, commctrl, activex). To avoid scoping problems (e.g. dangerous situations where the order of commctrl and windows in the uses clause matter) they are already removed from the Windows unit. This poses a barrier for Lazarus to use the winunits-base units, which was unacceptable. On top of this, the Windows unit versions weren't translated properly.

Specifically, listview_* functions were removed (already in commctrl) and openfilename* and some other precooked dialogue related functions were moved to commdlg.

Expansion

Since 2.0.4, the winunits-base units have been vastly expanded. Most notably retranslations of many headers were done to take advantage of better 2.0 support. (unicode versions now useful due to widestrings, interfaces, winbools/bytebools), and numerous small fixes that improve the Delphi compability of the declarations.

This process will probably continue for a while.

3.2.x series

The 3.2.x series has mostly some organic fixes and enhancements to the windows header units.

It should also enable structured exception handling which should improve handling COM objects that use exceptions internally


From the Free Pascal wiki, page "Windows API units", as it stood on 2020-01-26 after a change by Marcov, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's Licensing page. If you have concerns about this material, message the admin.

Revision 1, last changed by WikiArchive .

Talk about this page

Nobody has opened a bench for this page yet. Sign in to open one.