pour la creation de raccourcis j'utilise cette fonction:
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 bool __fastcall TForm1::CreateLink(AnsiString Obj, AnsiString Lnk, AnsiString Dsc) { IShellLink* pLink; IPersistFile* pPersistFile; if(SUCCEEDED(CoInitialize(NULL))) { if(SUCCEEDED(CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER, IID_IShellLink, (void **) &pLink))) { pLink->SetPath(Obj.c_str()); pLink->SetDescription(Dsc.c_str()); pLink->SetShowCmd(SW_SHOW); if (SUCCEEDED (pLink->QueryInterface(IID_IPersistFile, (void **) &pPersistFile))) { WideString strShortCutLocation(Lnk + ".lnk"); pPersistFile->Save(strShortCutLocation.c_bstr(), TRUE); pPersistFile->Release(); } else return false; } pLink->Release(); } CoUninitialize(); return true; }
j'aurais besoin de passer qq parametre dans le lien mais j'arrive pas a trouver comment!
Ex: mon application c:\toto.exe
dans le raccourcis je voudrais que la cible soit c:\toto.exe -All
mais je n'arrive pas a entrer l'argument -All
CreateLink("c:\\toto.exe -All", "Mon application", "Mon application")
Comment faire?
Partager