如题:
能具体的说一下吗
有个例子更好thanks

解决方案 »

  1.   

    如 szExePath 是完整路径char sPath[MAX_PATH];
    GetShortPathName(szExePath,sPath,MAX_PATH);
      

  2.   

    FAT32格式以后支持长、短文件名,有时一个很长的文件名如C:\Program Files\...变成短文件名后就是C:\Progra~1 \...
    相信你也见过,知道这个也就好理解这个方法的用法了。
    DWORD GetShortPathName(
      LPCTSTR lpszLongPath,  // null-terminated path string 原来的长文件名
      LPTSTR lpszShortPath,  // short form buffer 转换后的输出的短文件名
      DWORD cchBuffer        // size of short form buffer 短文件名缓冲区长度
    );
    CString szLongPath = "C:\\Program Files\....";
    char pszShortPath[_MAX_PATH] = {0};
    DWORD dwRet = GetShortPathName(szLongPath, pszShortPath, _MAX_PATH);
      

  3.   

    DWORD GetShortPathName(
      LPCTSTR lpszLongPath,  // pointer to a null-terminated path string
      LPTSTR lpszShortPath,  // pointer to a buffer to receive the 
                             // null-terminated short form of the path
      DWORD cchBuffer        // specifies the size of the buffer pointed 
                             // to by lpszShortPath
    );