D'après la msdn en vb.net je déclare SHSetFolderPath de cette manière:
Private
Declare
Unicode
Function SHSetFolderPathW
Lib
"shell32"
Alias
"#232" (
ByVal csidl
As
Integer,
ByVal hToken
As
Integer,
ByVal dwFlags
As
Integer,
ByVal pszPath
As IntPtr)
As
Integer
En C# je ne vois pas comment la déclarer.
Quelqu'un à t-il une idée ?
Merci
A voir également:
Déclaration existante dans la portée en cours
Vba déclaration existante dans la portée en cours - Meilleures réponses
lol je viens de lire ça dans la MSDN.. bon attends alors..
Remarks
SHSetFolderPath is not exported by name from Shell32.dll. To use the function, you must call GetProcAddress with ordinal 231 for SHSetFolderPathA (for ANSI strings) or ordinal 232 for SHSetFolderPathW (for Unicode strings) to obtain a function pointer.
It is recommended that the paths be expressed as Unicode strings because folder names may contain Unicode characters not expressible in ANSI.
Sa aurait été simple si la déclaration pour SHSetFolderPath se faisait de cette manière en c#.
Mais il est bien dit dans la msdn que SHSetFolderPath dans Shell32 n'a pas de point d'entrée par ce nom.
C'est pourquoi j'ai utiliser l'ordinal 232 dans ma déclaration vb.