Sign in to follow this  
Followers 0
rexx

SHGetFileInfo() not works for unicode path

3 posts in this topic

Hi, I use the following code to get icon for a path

Local $tSHFILEINFO = DllStructCreate("ptr;int;dword;char[260];char[80]")
        Local $aDllRet = DllCall("shell32.dll", "ptr", "SHGetFileInfo", "str", $sFile, "dword", 0x80, "ptr", DllStructGetPtr($tSHFILEINFO), "int", DllStructGetSize($tSHFILEINFO), "int", 0x1000)
        Local $sIconFile = DllStructGetData($tSHFILEINFO, 4)
        Local $nIconNumber = DllStructGetData($tSHFILEINFO, 2)

But if the $sFile contains unicode chars then it goes wrong.

I've search the SHGetFileInfo() on MSDN, and it should support unicode.

so where's the problem?

Share this post


Link to post
Share on other sites



You are calling the wrong function. It should be "SHGetFileInfoW" (and "wstr").


♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites

Thanks!

You are calling the wrong function. It should be "SHGetFileInfoW" (and "wstr").

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0