Bonjour a tous!
Voila j'utilise la methode fournie sur le site pour creer un raccourci de mon application, cependant j'aimerais savoir quelle est la methode pour rajouter un argument au raccourci.
C'est a dire au lieu d'obtenir dans les proprietes du raccourci creer "C:\toto\monpgm.exe" je voudrai avoir "C:\toto\monpgm.exe" -argument1
Voici le code utilise trouve sur le site:
Merci d'avance
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
33
34 #define NO_WIN32_LEAN_AND_MEAN #include <shlobj.h> //......... void __fastcall TForm1::Button1Click(TObject *Sender) { HRESULT hres; IShellLink* psl; WORD wsz[MAX_PATH]; CoInitialize(NULL); hres = CoCreateInstance(CLSID_ShellLink, NULL,CLSCTX_INPROC_SERVER, IID_IShellLink, (LPVOID *)&psl); if (SUCCEEDED(hres)) { IPersistFile* ppf; psl->SetPath("C:\\Windows\\calc.exe"); psl->SetDescription("Calculatrice"); psl->QueryInterface(IID_IPersistFile,(LPVOID *)&ppf); MultiByteToWideChar(CP_ACP, 0,"C:\\Windows\\Bureau\\Calc.lnk", -1, (LPWSTR)wsz, MAX_PATH); ppf->Save((LPWSTR)wsz, TRUE); ppf->Release(); } psl->Release(); CoUninitialize(); }
Partager