The information in this article applies to:
SUMMARYIn the Microsoft Windows environment, the GetModuleFileName function provides the filename of the executable file that corresponds to a given module instance handle or data instance handle. MORE INFORMATIONGetModuleFileName retrieves the full path of an application or a dynamic-link library (DLL). Specify the instance handle or module handle of the executable hModule parameter. The syntax of this function is:
The hModule parameter identifies the module or instance handle,
lpFilename points to the buffer to receive the file name, and nSize
specifies the buffer size.
When Windows launches an application, its instance handle is a parameter to WinMain. For a DLL, the instance handle is a parameter to LibMain. The instance handle is also available through the GetWindow function, as follows:
The GetModuleHandle function provides the module handle for a
specified module. For example, if Microsoft Excel is loaded, the full
path to the Excel executable file is available through the following
code:
Given a handle to a window or control in an application, the
GCW_HMODULE parameter to the GetClassWord function provides the
application's module handle.
Additional query words: no32bit 3.00 3.10
Keywords : kb16bitonly |
Last Reviewed: November 4, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |