Delphi Reference:

Where are API routines declared?

To find out in which unit a routine is declared, put the cursor on that identifier and press function key F1.

But why would you want to know that? Because if the declaring unit isn't known to Delphi's compiler, it stops with an "Undeclared identifier" error. In that case, simply add the declaring unit to the uses clause near the top of your unit.

Alas, in some cases Delphi's Help files don't show you where a certain routine is declared. This depends on: your version/edition of Delphi and whether an identifier is considered to be "built-in". Notably, the default Help tells you little or nothing about Win32 API functions. For example, where is the very popular ShellExecute declared?...

Here's a partial list of available Win32 API (Application Program Interface) routines and the units where they are declared:

Win32 API Routine Unit
CommandLineToArgvWShellApi
DoEnvironmentSubstShellApi
DragAcceptFilesShellApi
DragFinishShellApi
DragQueryFileShellApi
DragQueryPointShellApi
DuplicateIconShellApi
ExtractAssociatedIconShellApi
ExtractIconShellApi
FindExecutableShellApi
SHAddToRecentDocsSHLObj
SHAppBarMessageShellApi
SHBrowseForFolderSHLObj
Shell_NotifyIconShellApi
ShellAboutShellApi
ShellExecuteShellApi
ShellExecuteExShellApi
SHFileOperationShellApi
SHFreeNameMappingsShellApi
SHGetFileInfoShellApi
SHGetInstanceExplorerSHLObj
SHGetMalloc SHLObj
SHGetPathFromIDList SHLObj
SHGetSpecialFolderLocation SHLObj

TOP   DC Library  Crash Course Delphi  Tips  Source Code  Downloads  Links