Bonjour à tous,

J'aimerais faire un exe qui crée des raccourcis, j'ai trouvé qq sources seulement il n'y a rien en C pour Dev C, il n'y a que des sources en VC++ (que je ne maitrise pas).

Est ce que quelqu'un pourrait m'aider à convertir cette source:

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include <stdio.h>
#include <windows.h> 
#include <shlobj.h> 
#include <commdlg.h> 
  
void AddInStartupGrp&#40;LPSTR szShortcutFile,LPSTR szSourcePath&#41;&#123;
    HRESULT hres;
    IShellLink *psl;
    char LNKpath&#91;_MAX_PATH&#93;;
    WORD wsLNKpath&#91;MAX_PATH&#93;;
    LPITEMIDLIST pItemIDlist;
    
    SHGetSpecialFolderLocation&#40;m_hWnd,CSIDL_STARTUP,&pItemIDlist&#41;;
    SHGetPathFromIDList&#40;pItemIDlist,LNKpath&#41;;
    strcat&#40;LNKpath,"\\"&#41;;
    strcat&#40;LNKpath,"szShortcutFile"&#41;;
    
    hres = CoCreateInstance&#40;CLSID_ShellLink, NULL,
    CLSCTX_INPROC_SERVER,
    IID_IShellLink,&#40;void **&#41;&psl&#41;;
    if &#40;SUCCEEDED &#40;hres&#41;&#41;&#123;
        IPersistFile *ppf;
        hres = psl->QueryInterface&#40;IID_IPersistFile,&#40;void **&#41;&ppf&#41;;
        if &#40;SUCCEEDED &#40;hres&#41;&#41;&#123;
        hres = psl->SetPath&#40;szSourcePath&#41;;
        MultiByteToWideChar&#40;CP_ACP, 0, LNKpath, -1,
        wsLNKpath,MAX_PATH&#41;;
        hres = ppf->Save&#40;wsLNKpath,FALSE&#41;;
        ppf->Release &#40;&#41;;
    &#125;
    psl->Release &#40;&#41;;
&#125;// */
Certaines fonctions et variables sont inconnues (pb de bibliotheques ?)

Merci d'avance.