Re: GetModuleFileNameEx

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: daniel kaplan (nospam_at_nospam.com)
Date: 09/02/04


Date: Thu, 2 Sep 2004 17:03:29 -0400

below is EVERYTHING my MSDN has for it...not a mention of libs, h's
nothing...but that leads to an important question:

does this function ONLY in NT version (2k, etc)

cause i need 95 and 98....so if that's the case, i will have to go the
longer route with the SNAPSHOT

GetModuleFileNameEx
The GetModuleFileNameEx function retrieves the fully qualified path for the
specified module.
DWORD GetModuleFileNameEx(
  HANDLE hProcess, // handle to the process
  HMODULE hModule, // handle to the module
  LPTSTR lpFilename, // buffer that receives the path
  DWORD nSize // size of the buffer
);

Parameters
hProcess
Handle to the process that contains the module.
hModule
Handle to the module.
lpFilename
Pointer to the buffer that receives the fully qualified path to the module.
nSize
Specifies the size, in bytes, of the lpFilename buffer.
Return Value
If the function succeeds, the return value specifies the length of the
string copied to the buffer.
If the function fails, the return value is zero. To get extended error
information, call GetLastError.
See Also
Process Status Helper Overview, PSAPI Functions, EnumProcesses,
GetModuleBaseName



Relevant Pages

  • Re: Two bugs in GetPrivateProfileSectionNamesA
    ... DWORD nCount = GetPrivateProfileSectionNamesA(buffer, nSize, NULL); return 0;} ... set to the promised terminating null character. ... When your buffer contains exactly the number of bytes needed, you will see the bug. ... The return value specifies the number of characters copied to the specified buffer, not including the terminating null character. ...
    (microsoft.public.win32.programmer.tools)
  • Re: WinXP x64 - WriteFile() returns "Insufficient system resources exist to complete the request
    ... And, as MS specifies, I am using ... > Do you have a reference which specifies what a "large buffer" is defined ... Buffers bigger than the combined hardware + drivers maximum transfer ...
    (microsoft.public.win32.programmer.kernel)
  • Re: _sntprintf and _sntprintf_s
    ... in MSDN library United States. ... Maximum number of characters to store, ... This really specifies the size of the ... may not be related to buffer size, e.g., you may only want to copy 3 ...
    (microsoft.public.vc.language)
  • Re: Two bugs in GetPrivateProfileSectionNamesA
    ... set to the promised terminating null character. ... There are a problem in the doc, if the buffer we passed is larger than required, it returns 339; at this time, according to doc, it should return 339-1=338. ... |>The return value specifies the number of TCHARs copied to the specified ... Thanks very much for your time to report these issues, ...
    (microsoft.public.win32.programmer.tools)
  • Re: GetWinFileName
    ... from news below to give me the executable's name upon passing the ... hModule: THandle; ... GetWinFileNameAProc: GetWinFileNameA; ... GetWinFileNameAProc(hWnd, Buffer, 255); ...
    (comp.lang.pascal.delphi.misc)