Skip to content

Latest commit

 

History

History
60 lines (45 loc) · 2.16 KB

File metadata and controls

60 lines (45 loc) · 2.16 KB

Home

Function name : GetModuleFileName

Group: Dynamic-Link Library - Library: kernel32


Retrieves the full path and file name for the file containing the specified module.


Code examples:

Creating a unique filename based on existing filename
Finding the path to the VFP executable running
How to view icons stored in executable files (Icon Viewer)
Using GetBinaryType (WinNT only) to determine the type of an executable file
Retrieving information about the specified icon
Displaying icons in the system tray (VFP9)
Retrieving file information for the VFP executable running
How to display the Properties dialog box for a file (ShellExecuteEx)
Using FoxTray ActiveX control: System Tray Icon and menu attached to VFP form
GDI+: custom Clock Control

Declaration:

DWORD GetModuleFileName(
  HMODULE hModule,    // handle to module
  LPTSTR lpFilename,  // file name of module
  DWORD nSize         // size of buffer
);  

FoxPro declaration:

DECLARE INTEGER GetModuleFileName IN kernel32;
	INTEGER  hModule,;
	STRING @ lpFilename,;
	INTEGER  nSize  

Parameters:

hModule [in] Handle to the module whose file name is being requested. If this parameter is NULL, GetModuleFileName returns the path for the file containing the current process.

lpFilename [out] Pointer to a buffer that receives the path and file name of the specified module.

nSize [in] Specifies the length, in TCHARs, of the lpFilename buffer. If the length of the path and file name exceeds this limit, the string is truncated.


Return value:

If the function succeeds, the return value is the length, in TCHARs, of the string copied to the buffer.