Bonjour,
Je suis en Delphi 7 et sur un Windows 10.
Comment analyser le contenu d'un raccourci .LNK avec comme cible d'après les propriétés Windows du fichier une adresse du type {7C5...}\Cyberlink....?
D'avance grand merci.
Bonjour,
Je suis en Delphi 7 et sur un Windows 10.
Comment analyser le contenu d'un raccourci .LNK avec comme cible d'après les propriétés Windows du fichier une adresse du type {7C5...}\Cyberlink....?
D'avance grand merci.
Un début de piste dans la faq :
https://delphi.developpez.com/faq/?p...ci-de-type-LNK
L'urgent est fait, l'impossible est en cours, pour les miracles prévoir un délai. :bug: ___ "http://club.developpez.com/regles/#LIII-A"Écrivez dans un français correct !!
C++Builder 5 - Delphi 6#2 Entreprise - Delphi 2007 Entreprise - Delphi 2010 Architecte - Delphi XE Entreprise - Delphi XE7 Entreprise - Delphi 10 Entreprise - Delphi 10.4.2 Entreprise - Delphi 11.3 Entreprise - Visual studio 2022
OpenGL 2.1 - Oracle 10g - Paradox - Interbase (XE) - PostgreSQL (15.7)
Bonjour,
Quelques remarques à propos du lien
https://delphi.developpez.com/faq/?p...ci-de-type-LNK
L'origine semble être :
https://www.developpez.net/forums/d1...d-fichier-lnk/
de ShaiLeTroll qui précise :
Essaye mon code remplaçant IID_IShellLinkW par IID_IShellLinkA si tu es en D7
D'autre part
J'ai essayé avec
Code : Sélectionner tout - Visualiser dans une fenêtre à part LResult := LPersistFile.Load(PChar(AShellLinkFileName), STGM_READ); // Erreur de compilation
Mais cela ne fonctionne pas : aucune réponse.
Code : Sélectionner tout - Visualiser dans une fenêtre à part LResult := LPersistFile.Load(PWideChar(AShellLinkFileName), STGM_READ);
D'avance merci.
Bonjour,
code testé Ok sous D7 & win7Codialement,
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48 unit UIShellLNK; interface uses Windows, ShellApi, ShlObj, Messages, ActiveX, Classes, SysUtils; type /// <summary>TSLTShellLink encapsule l'utilisation de l'interface IShellLink</summary> TSLTShellLink = class(TObject) public class function ExtractTarget(const AShellLinkFileName: TFileName): TFileName; end; implementation { TSLTShellLink } //------------------------------------------------------------------------------ class function TSLTShellLink.ExtractTarget(const AShellLinkFileName: TFileName): TFileName; // Voir la fonction cachée "GetFileNameFromLink" dans Vcl.ExtDlgs // Ne pase inclure Winapi.Ole2 qui contient IID_IPersistFile, cela devient trop pénible les conflits entre TGUID de Delphi et TGUID de Winapi.Ole2 const IID_IPersistFile: TGUID = '{0000010B-0000-0000-C000-000000000046}'; var LResult: HRESULT; LSHellLink: IShellLink; LPersistFile: IPersistFile; LFindData: TWin32FindData; FileName: array[0..MAX_PATH - 1] of Char; begin Result := ''; LResult := CoCreateInstance(CLSID_ShellLink, nil, CLSCTX_INPROC_SERVER, IID_IShellLinkA, LShellLink); if LResult = S_OK then begin if Supports(LShellLink, IID_IPersistFile, LPersistFile) then begin LResult := LPersistFile.Load(PWideChar(WideString(AShellLinkFileName)), STGM_READ); if LResult = S_OK then begin LResult := LSHellLink.GetPath(FileName, MAX_PATH, LFindData, SLGP_UNCPRIORITY); if LResult = S_OK then Result := Trim(FileName); end; end; end; end; end.
@+
Bonjour,
Désolé, après mes essais complémentaires toujours sur Delphi 7 et surtout Windows 10 j'ai 5 raccourcis à problèmes :
Skype :
d'après Propriétés de Microsoft cible :
Microsoft.SkypeApp-kzf8qxf38zg5c!App
Edge :
d'après Propriétés de Microsoft cible :
Microsoft.MicrosoftEdge_8wek...................
Paint 3D :
d'après Propriétés de Microsoft cible :
Microsoft.MSPaint_8wekyb...........
MakeCode for microbit :
d'après Propriétés de Microsoft cible :
MicrosoftEducationalFounda.196216C478B_e88r6s0B2swar!A..
CyberLink_Power2Go
d'après Propriétés de Microsoft cible :
{7C5A40EF-....}Cyberlink/Pov....
D'avance merci
Partager