Youpien
Messages postés29Date d'inscriptionsamedi 31 janvier 2004StatutMembreDernière intervention22 février 2009
-
19 août 2005 à 16:30
Youpien
Messages postés29Date d'inscriptionsamedi 31 janvier 2004StatutMembreDernière intervention22 février 2009
-
19 août 2005 à 16:30
Salut a tous, j'ai un petit probleme, j'ai fais un programme avec une listview en mode lvwreport, mais les icones en debut de ligne sont tous petit on les voit a peine!!*
Quelqu'un pourrait t'il m'aider??
Voici une partie de mon code source, en faite le programme extrait les icone d'un programme pour les placer dans une listview, la partie extraction est elle placer dans un module.
dans mon form 1 :
<quote>
Private Sub Lol()
Dim jj, j, ord2, prog, pp
ListView1.View = lvwReport
Set ListView1.SmallIcons = Nothing
ImageList1.ListImages.Clear
ImageList1.ImageHeight = 16
ImageList1.ImageWidth = 16
ImageList1.ListImages.Add 1, , Me.Icon
Set ListView1.SmallIcons = ImageList1
ListView1.ListItems.Clear
le programme va chercher dans un fichier ini la liste des executables dont il faut extraire les icones.
et voici mon module :
<quote>
Private Declare Function ExtractIcon Lib "shell32.dll" Alias "ExtractIconA" ( _
ByVal hInst As Long, _
ByVal lpszExeFileName As String, _
ByVal nIconIndex As Long) As Long
Private Declare Function DrawIcon Lib "user32.dll" ( _
ByVal hDC As Long, _
ByVal X As Long, _
ByVal Y As Long, _
ByVal hIcon As Long) As Boolean
Private Declare Function DestroyIcon Lib "user32.dll" ( _
ByVal hIcon As Long) As Boolean
Public Sub Extraire(Path, Comm)
Static lngRefresh As Long
Dim Index As Integer
Dim hIcon As Long
Dim b As Boolean
Dim X As ListImage
Dim itmX As ListItem
hIcon = ExtractIcon(Form1.hWnd, Path, Index)
Form1.Picture1.Picture = LoadPicture(vbNullString)
b = DrawIcon(Form1.Picture1.hDC, 0, 0, hIcon)
Set X = Form1.ImageList1.ListImages.Add(, , Form1.Picture1.Image)
b = DrawIcon(Form1.ImageList1.hImageList, 0, 0, hIcon)
Set itmX = Form1.ListView1.ListItems.Add()
itmX.SmallIcon = X.Index
itmX.Text = Path
itmX.SubItems(1) = Comm