Bonjour,
Je ne sais pas si il y a un grand guru du perl qui a qq notions en C sur ce forum mais sinon j'aurai besoin d'un peu (beaucoup) d'aide pour
pouvoir mettre en oeuvre les fonctions "SHSetKnownFolderPath" et "SHChangeNotify" (pour pouvoir rediriger partiellement le profil utilisateur).
http://msdn.microsoft.com/en-us/libr...49(VS.85).aspx
http://msdn.microsoft.com/en-us/libr...18(VS.85).aspx
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7 HRESULT SHSetKnownFolderPath( __in REFKNOWNFOLDERID rfid, __in DWORD dwFlags, __in HANDLE hToken, __in PCWSTR pszPath );
Voici 1 exemple concret en C :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7 void SHChangeNotify( LONG wEventId, UINT uFlags, __in_opt LPCVOID dwItem1, __in_opt LPCVOID dwItem2 );
http://social.msdn.microsoft.com/For...7-fa1faea3fbbd
J'ai testé un autre exemple en autoit mais cette fois ci avec la fonction SHGetKnownFolderPath :
http://www.autoitscript.com/forum/to...ost__p__489845
* on trouve beaucoup d'exemples de fonctions implémentées via "autoit" (du coup ça renseigne sur les types, structures et constantes).
Pour obtenir le "REFKNOWNFOLDERID", il faut utiliser la fonction "CLSIDFromString" :
Le pointeur "pclsid" référence à priori une structure du type 'lssC8' (j'ai traduit d'autoit en perl pack) :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5 HRESULT CLSIDFromString( LPOLESTR lpsz, LPCLSID pclsid );
http://www.autoitscript.com/autoit3/...s/$tagGUID.htm
http://www.autoitscript.com/autoit3/...ructCreate.htm
http://perldoc.perl.org/functions/pack.html
Du coup, pour l'instant j'en suis là (mais je n'arrive pas à récupérer le clsid) :
Merci d'avance pour votre aide !!!
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11 use strict; use Win32; use Win32::API; $Win32::API::DEBUG = 1; # intialisation du pointeur my $pclsid = pack ('lssC8', "x\00" ); # initialisation de la fonction my $CLSIDFromString = new Win32::API("Ole32", 'CLSIDFromString', 'NP', 'N') || die; # appel de la fonction $CLSIDFromString->Call('{4BD8D571-6D19-48D3-BE97-422220080E43}', $pclsid );
Partager