Ver Mensaje Individual
  #2 (permalink)  
Antiguo 11/05/2005, 16:35
Avatar de David
David
Moderador
 
Fecha de Ingreso: abril-2005
Ubicación: In this planet
Mensajes: 15.720
Antigüedad: 19 años, 1 mes
Puntos: 839
Si sabes la Ruta del Acceso Directo será fácil

Private Declare Function SHGetFileInfo Lib "shell32.dll" Alias "SHGetFileInfoA" (ByVal pszPath As String, ByVal dwFileAttributes As Long, psfi As SHFILEINFO, ByVal cbFileInfo As Long, ByVal uFlags As Long) As Long
Private Declare Function ImageList_Draw Lib "comctl32.dll" (ByVal himl&, ByVal i&, ByVal hDCDest&, ByVal X&, ByVal y&, ByVal flags&) As Long
Private Const SHGFI_SYSICONINDEX = &H4000 ' get system icon index
Private Const SHGFI_LARGEICON = &H0 ' get large icon
Private Const ILD_TRANSPARENT = &H1
Private shinfo As SHFILEINFO
Private xPixels As Integer
Private yPixels As Integer
Private Const MAX_PATH = 260
Private Type SHFILEINFO
hIcon As Long
iIcon As Long
dwAttributes As Long
szDisplayName As String * MAX_PATH
szTypeName As String * 80
End Type
Private Sub Form_Load()
xPixels = Screen.TwipsPerPixelX
yPixels = Screen.TwipsPerPixelY
IconoGrande "D:\Documents and Settings\All Users\Menú Inicio\Programas\Microsoft Visual Basic 6.0\Microsoft Visual Basic 6.0.lnk"
'Acceso Directo de Ejemplo (te devolverá el ícono de vb)
End Sub
Sub IconoGrande(Path As String)
Dim himl As Long
Dim lpzxExeName As String
Dim nRet As Long
Dim picLeft As Long
Dim picTop As Long
lpzxExeName = Path
himl = SHGetFileInfo(lpzxExeName, 0&, shinfo, Len(shinfo), SHGFI_SYSICONINDEX Or SHGFI_LARGEICON)
picLeft = (Picture1.ScaleWidth / xPixels) / 2 - 16
picTop = (Picture1.ScaleHeight / yPixels) / 2 - 16
Picture1.Picture = LoadPicture()
Picture1.AutoRedraw = True
nRet = ImageList_Draw(himl, shinfo.iIcon, Picture1.hDC, picLeft, picTop, ILD_TRANSPARENT)
Picture1.Refresh
End Sub

Te devolverá en el Picture1 el ícono
__________________
Por favor, antes de preguntar, revisa la Guía para realizar preguntas.