tags:

views:

87

answers:

2
+1  A: 

Nah, that's not it. The error code, converted to hex, is 0x80070057. The 7 indicates a Windows error, 57 is error code 87, ERROR_INVALID_PARAMETER, "The parameter is incorrect".

A couple of possible reasons. First is that entry point #232 isn't actually the entry point for SHSetFolderPath(). You might be calling a different function, it wouldn't know what to do with the argument values you pass. Hard to say, it is an unnamed entry point on XP's version of shell32.dll. Or it could be that XP just isn't happy about you changing the desktop folder path. Not that surprising, there's a heckofalot it has to do to actually implement that, refreshing all Explorer.exe views, rebuilding the desktop contents and whatnot.

Check this thread for possible help.

Hans Passant
Thanks for answer. I think the entry point should be correct, since it's given in MSDN library. I am familiar with thread you have linked, it helped me with ShSetKnownFolderPath, but the post about ShSetFolderPath seems wrong. I've tried many combinations with the arguments, and no one worked for me. So, the question is still open. Damn, Windows is sooo mysteriuos :). Oh, and good point about changing desktop location. Maybe it's impossible to change desktop on WinXP. I'm gonna try to change some other folder.
pipboy3k
A: 

Funny thing.
I've taken another look at CSIDL list. And I've realized I was trying to change some "low-level" reference (i guess) to desktop:
CSIDL_DESKTOP = 0x0000, // <desktop>
While I actually wanted to change just folder location, and i should've use this:
CSIDL_DESKTOPDIRECTORY = 0x0010, // <user name>\Desktop.
And THIS works.

It explains everything. Shame on me.

pipboy3k