How to Display a file's associated icon?



How to Display a file's associated icon?..

Answer / Niharika Nandan

To display a file's associated icon in Delphi, follow these steps:
1. Create an Icon variable.nIcon := TIcon.Create(nil);
2. Set the Icon's Handle property to the file's icon handle using SHGetFileInfo() function:nSHGetFileInfo(PChar(FileName), FOFI_ICON, lpIconData, nSizeNeeded, &fofi)
3. Display the Icon as needed

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Delphi Interview Questions

What is the history of Delphi?

1 Answers  


How does one change the default directory that Delphi uses to save projects?

1 Answers  


Does Kylix support ODBC?

1 Answers  


How to retrieve an InterBase Blob in Delphi using SavetoFile?

1 Answers  


'General SQL Error : Connection does not exist' in threaded application . what does this indicates?

1 Answers  


How to get UpdateMode to work for TQuery on a SQL Server 7.0 table?

1 Answers  


How to Set the caption of the preview window?

1 Answers  


How to Create Non-Visual Components Without Icons ?

1 Answers  


Does Delphi have an equivalent for the VB function DoEvents?

1 Answers  


How to Initialize an array or record to null?

1 Answers  


How to use a true DWORD value passed to Delphi application?

1 Answers  


Write a program to show the memory leak?

1 Answers  


Categories