cs_Stef
Messages postés5Date d'inscriptionvendredi 30 novembre 2001StatutMembreDernière intervention 6 décembre 2006
-
21 mars 2002 à 21:53
cs_moonstar
Messages postés3Date d'inscriptionjeudi 9 septembre 2004StatutMembreDernière intervention11 octobre 2005
-
9 sept. 2004 à 14:43
Quelqu'un a t-il la soluce pour récupérer l'icone d'un exe ?
Neo.balastik
Messages postés796Date d'inscriptionjeudi 17 mai 2001StatutMembreDernière intervention 5 mai 20097 26 mars 2002 à 16:00
Salut,
Un bout de code qui permet de récupérer l'icone de REGEDIT.EXE. Donc il te sera facile de le faire pour un autre exécutable.
Private Declare Function DrawIcon Lib "user32" Alias "DrawIcon" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal hIcon As Long) As Long
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 GetWindowsDirectory Lib "kernel32" Alias "GetWindowsDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As Long
Private Sub Form_Load()
Dim Path as String, strSave as string
'Create a buffer string
strSave = String(200, Chr$(0))
'Get the windows directory and append '\REGEdit.exe' to it
Path = Left$(strSave, GetWindowsDirectory(strSave, Len(strSave))) + "\REGEdit.exe"
'No pictures
Picture1.Picture = LoadPicture()
'Set graphicmode to 'persistent
Picture1.AutoRedraw = True
'Extract the icon from REGEdit
return1& = ExtractIcon(Me.hWnd, Path, 2)
'Draw the icon on the form
return2& = DrawIcon(Picture1.hdc, 0, 0, return1&)
End Sub
cs_moonstar
Messages postés3Date d'inscriptionjeudi 9 septembre 2004StatutMembreDernière intervention11 octobre 2005 9 sept. 2004 à 14:43
Quelqu'un aurait-il une solution viable dans le meme genre en C# ?
D'avance merci.
---------------------------------------------------------
Il y a de plus en plus de cons d'année en année mais j'ai l'impression que les cons de l'année prochaine sont déjà là.