PDA

View Full Version : Is there something like WChar instead of Char?



WWGT
6-Jan-2023, 02:35 AM
Trying to translate an external api call from SHGetFileInfoA to SHGetFileInfoW.
According to MSDN that would return a SHFILEINFOW structure. https://learn.microsoft.com/en-us/windows/win32/api/shellapi/ns-shellapi-shfileinfow

The old type was defined as this

Type SHFILEINFO
Field SHFILEINFO.hIcon as Handle
Field SHFILEINFO.iIcon as Integer
Field SHFILEINFO.dwAttributes as DWord
Field SHFILEINFO.szDisplayName as Char MAX_PATH
Field SHFILEINFO.szTypeName as Char 80
End_Type

How would one go about converting a structure that now expects WCHAR instead of CHAR?

Vincent Oorsprong
6-Jan-2023, 05:06 AM
Nick,

Make the members an array of SHORTs. So:


Struct tSHFileInfo
...
Short[MAX_PATH] szDisplayName
...
End_Struct