Fonctionement de SHGetFolderPath

Sens0r Messages postés 35 Date d'inscription lundi 23 janvier 2006 Statut Membre Dernière intervention 23 mars 2006 - 19 mars 2006 à 13:55
Sens0r Messages postés 35 Date d'inscription lundi 23 janvier 2006 Statut Membre Dernière intervention 23 mars 2006 - 23 mars 2006 à 07:37
Bonjour,

est-ce que quelqu'un pourrait me montrer dans un exemple comment la fonction 'SHGetFolderPath' fonctione?

Voici le lien vers la msdn:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/reference/functions/shgetfolderpath.asp

Je sais que cette question est un peu stupide, mais je na parviens pas à la faire fonctioner.

Je serai très content si vous pourriez me fournir un example.

salutations,
Sens0r

3 réponses

julienbornet Messages postés 99 Date d'inscription jeudi 9 février 2006 Statut Membre Dernière intervention 2 février 2009
20 mars 2006 à 14:51
0
julienbornet Messages postés 99 Date d'inscription jeudi 9 février 2006 Statut Membre Dernière intervention 2 février 2009
22 mars 2006 à 23:01
Un autre exemple torouver sur le net (c plus clair):

case ID_ID: //your control, menu, and or accelerator id
{ char sz1[512] = "", sz2[512] = "";
//get your app.exe path
GetModuleFileName(NULL, sz1, 512);
strrev(sz1);
char* p = strchr(sz1, '\\');
if(p) //always true, just in case something so weird happened
{ strcpy(sz2, p);
strrev(sz2);
//add path with your_help.chm::/target_to_go.html
//this assuming that your exe path = your help path
strcat(sz2, "help.chm::/intro.html");
//look for hh.exe (hh = HtmlHelp) which located in %WINDIR%
SHGetFolderPath(NULL, CSIDL_WINDOWS, NULL, SHGFP_TYPE_CURRENT, sz1);
strcat(sz1, "[file://hh.exe/ \\hh.exe]");
//shellexecute it
if((int)ShellExecute(NULL, "open", sz1, sz2, NULL, SW_SHOWNORMAL) <= 32)
{ MessageBox(hwnd, "A file is missing, pls reinstall this app", "Error",
MB_ICONERROR | MB_TASKMODAL);
}
}
return 0;
}

adresse du site: http://www.codeproject.com/useritems/bcc55_vs_htmlhelp_lib.asp
0
Sens0r Messages postés 35 Date d'inscription lundi 23 janvier 2006 Statut Membre Dernière intervention 23 mars 2006
23 mars 2006 à 07:37
Ok, merci beaucoup, je vais regarder ca.

Saltuations,
Sens0r
0
Rejoignez-nous