有一个EXE文件 a.exe 处于目录 c:\aaa\bbb\a.exe 中我在目录 c:\aaa 中键入 .\bbb\a.exe 以运行 a.exe请问在 a.exe 中使用哪个 WIN32 API 以获得 a.exe 所在的全路径字符串
注意:不是获得当前路径。
请各位大拿鼎力相助,谢谢。

解决方案 »

  1.   

    The GetModuleFileName function retrieves the full path and filename for the executable file containing the specified module. Windows 95: The GetModuleFilename function will return long filenames when an application's version number is greater than or equal to 4.00 and the long filename is available. Otherwise, it returns only 8.3 format filenames.DWORD GetModuleFileName(
      HMODULE hModule,    // handle to module to find filename for
      LPTSTR lpFilename,  // pointer to buffer to receive module path
      DWORD nSize         // size of buffer, in characters
    );
      

  2.   

    请问在DOS环境中,是否有对应API函数,如BC++3.1?