Forums - C# Corner

Forum guidelines

Extract icon from exe, dll, or ico file

Mar 7 2004 1:08 AM
I make an application that is similar to windows explorer. The problem is I don't know how to extract the icon from a file. I learn from a post about the same problem in vb. This is the code that I translate from vb to c#: [DllImport("shell32.dll")] public static extern long ExtractIcon(long lngInst, string strExeFileName, long lngIconIndex); [DllImport("user32.dll")] public static extern long DrawIcon(long lngDC, long lngX, long lngY, long lngIcon); the problem for this codes is, What are the lngInst and lngDC in C#? Please help me to do this. Thanks in advanced.

Answers (1)

C# Corner Hyderabad Developer Conference

SPONSORED BY

Spire.Doc - Free .NET Word API
Use Spire.Doc to create, read, write, print, and convert word documents to OpenXML, RTF, TXT, XPS, EPUB, EMF, HTML, Image and PDF.