System.GetModuleFileName

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function GetModuleFileName(Module: HMODULE; Buffer: PChar; BufLen: Integer): Integer;

Properties

Type Visibility Source Unit Parent
function public System.pas System System

Description

Returns the fully qualified name for a module, given its handle.

Call GetModuleFileName to obtain the fully qualified name of a module, given its handle. On Windows, use the Windows API with the same name instead.

Module is the handle of the module whose file name is required.

Buffer is a buffer that receives the file name.

BufLen is the number of bytes in Buffer.

GetModuleFileName returns the number of bytes written to Buffer.

Warning: GetModuleFileName is not always successful. Depending on the way the application is called, the presence of the /proc file system, and other factors, there are times when GetModuleFileName may return a name that is not fully qualified or, in some cases, no file name at all. Be sure to check the results of this function before using the returned value.

See Also