element Posted June 12, 2004 Posted June 12, 2004 Hey all, OK I've figured out extracting an icon from Shell32 using the ExtractIcon API like this: <DllImport("shell32.dll", CallingConvention:=CallingConvention.Cdecl)> _ Private Shared Function ExtractIcon _ (ByVal hIcon As IntPtr, _ ByVal lpszExeFileName As String, _ ByVal nIconIndex As Integer) As IntPtr End Function Private m_Icon as Icon Private Sub GetIcon() hIcon = ExtractIcon(IntPtr.Zero, "shell32.dll", 4) m_Icon = Icon.FromHandle(hIcon).Clone DestroyIcon(hIcon) End Sub Private Sub picIcon_Paint(ByVal sender As Object, _ ByVal e As System.Windows.Forms.PaintEventArgs) Handles picIcon.Paint e.Graphics.DrawIcon(m_Icon, 0, 0) End Sub OK this isn't my exact code however it demonstates what is going on. I would like to know how to extract the 48x48 (with alpha) icon from Shell32.dll. ExtractIcon doesn't seem to have any parameters for what format icon you need. ExtractIconEx is no better. Thanks in advance for any input, Tom Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.