lunes, 27 de junio de 2011

Extraer Icono de un exe

Imports System.Runtime.InteropServices Imports System.Reflection  Public Class Form1  Private Declare Auto Function ExtractIcon Lib "shell32.dll" ( _ ByVal hInst As System.IntPtr, _ ByVal lpszExeFileName As String, _ ByVal nIconIndex As Integer) As System.IntPtr  Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim hIcon As System.IntPtr = ExtractIcon(Marshal.GetHINSTANCE(Assembly.GetExecutingAssembly().GetModules() (0)), "C:\windows\notepad.exe", 0) Me.PictureBox1.Image = Bitmap.FromHicon(hIcon) End Sub End Class

No hay comentarios:

Publicar un comentario