Simplesurfer
Messages postés2Date d'inscriptionvendredi 30 novembre 2007StatutMembreDernière intervention20 avril 2008
-
20 avril 2008 à 23:29
PCPT
Messages postés13280Date d'inscriptionlundi 13 décembre 2004StatutMembreDernière intervention 3 février 2018
-
21 avril 2008 à 00:42
salut
je cherche une source pour trouver les icones de tous les genres de type de disue (disque dur,disquette,removable...) meme si le disque absent dans le pc (virtuel).
PCPT
Messages postés13280Date d'inscriptionlundi 13 décembre 2004StatutMembreDernière intervention 3 février 201848 21 avril 2008 à 00:42
salut,
Private Const DI_MASK As Long = &H1
Private Const DI_IMAGE As Long = &H2
Private Const DI_NORMAL As Long = DI_MASK Or DI_IMAGE
Private Declare Function ExtractAssociatedIcon Lib "shell32.dll" Alias "ExtractAssociatedIconA" (ByVal hInst As Long, ByVal lpIconPath As String, lpiIcon As Long) As
Long
Private Declare Function DrawIconEx Lib "user32" (ByVal hdc As Long, ByVal xLeft As Long, ByVal yTop As Long, ByVal hIcon As Long, ByVal cxWidth As Long, ByVal cyWidth As Long, ByVal istepIfAniCur As Long, ByVal hbrFlickerFreeDraw As Long, ByVal diFlags As Long) As
Long
Private Declare Function DestroyIcon Lib "user32" (ByVal hIcon As Long) As Long
' repris de
l'API-Guid
Private Sub DrawIcon(ByVal sSource As String, ByVal lLeft As Long, ByVal lTop
As Long)
Dim mIcon As Long
'Extract the associated icon
mIcon = ExtractAssociatedIcon(App.hInstance, sSource, 2&)
'Draw the icon on the form
DrawIconEx Me.hdc, lLeft, lTop, mIcon, 0, 0, 0, 0, DI_NORMAL
'remove the icon from the memory
DestroyIcon mIcon
End Sub
Private Sub Form_Paint()
Call DrawIcon("D:", 0, 0)
Call DrawIcon("R:", 0, 50)
Call DrawIcon("C:\autoexec.bat", 0, 100)
End Sub
++
<hr size="2" width="100%" />Prenez un instant pour répondre à [infomsg_SONDAGE-POP3-POUR-CS_769706.aspx ce sondage] svp