ShellExplorerAPI.SHGetFileInfo() is displaying " ?????" for other language folder names.

  • Thread starter Thread starter Thirupathi Yadav
  • Start date Start date
T

Thirupathi Yadav

Guest
I use "SHGetFileInfo()" and the structure "SHFILEINFO" to get the name of the folders and drives which present in windows operating system.

If a localized operating system to change the setting "Current language for non-Unicode programs", these functions return a value "??? ?????????" for Japanese language folders.this is my reference code to get the file name.


[DllImport("shell32.dll")]
public static extern IntPtr SHGetFileInfo(string pszPath, uint dwFileAttribs, out SHFILEINFO psfi, uint cbFileInfo, SHGFI uFlags);

public struct SHFILEINFO
{
public IntPtr hIcon;
public int iIcon;
public uint dwAttributes;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 260)]
public string szDisplayName;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 80)]
public string szTypeName;
}

public string DisplayName
{
get { return m_strDisplayName; }
set { m_strDisplayName = value; }
}

For getting file path File path, I'm using below constructor to call every time to get path . but "shInfo.szDisplayName" is return a value "??? ?????????" instead of Japanese folder name in En-Us Operating system.

public ShellItem()
{
DisplayName = shInfo.szDisplayName; /////This is one used to get the file path

}

Find the below image to show the application folder name with respect to windows explorer.

Please help me on this.

Continue reading...
 
Back
Top