• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 605
  • Last Modified:

Delphi 2010: Get Description for .lnk file for Disk Defragmenter

Hi,
In Windows 7 I have a file in my Start Menu with the name dfrgui.lnk.
In the Start Menu this one is displayed as 'Disk Defragmenter', but as I said the file is named dfrgui.lnk
That .lnk file points to %windir%\system32\dfrgui.exe
The description for that file is 'Microsoft (R) Disk Defragmenter', so that is a different value as well.
I'm looking for a way to get the text 'Disk Defragmenter' from the dfrgui.lnk file, so I can display it in 'my own Start Menu'.
Thanks.
0
tacojoosterkamp
Asked:
tacojoosterkamp
1 Solution
 
thiagoblimeiraCommented:
Simple, this procedure will recover 'Disk Defragmenter' from the dfrgui.lnk file

uses ShellAPI

procedure TForm1.GetFileDisplayName(strPath: string; var DisplayName: string);
var
  FileInfo: SHFILEINFO;
begin
   //Get The DisplayName
   SHGetFileInfo(PChar(strPath), 0, FileInfo, SizeOf(FileInfo), SHGFI_DISPLAYNAME);
   DisplayName := FileInfo.szDisplayName;
end;
0
 
tacojoosterkampAuthor Commented:
Thanks - works like charm!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now