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 |
What is the history of Delphi?
How does one change the default directory that Delphi uses to save projects?
Does Kylix support ODBC?
How to retrieve an InterBase Blob in Delphi using SavetoFile?
'General SQL Error : Connection does not exist' in threaded application . what does this indicates?
How to get UpdateMode to work for TQuery on a SQL Server 7.0 table?
How to Set the caption of the preview window?
How to Create Non-Visual Components Without Icons ?
Does Delphi have an equivalent for the VB function DoEvents?
How to Initialize an array or record to null?
How to use a true DWORD value passed to Delphi application?
Write a program to show the memory leak?