sheffy222
Messages postés7Date d'inscriptionlundi 6 mars 2006StatutMembreDernière intervention16 mars 2006
-
16 mars 2006 à 22:49
valtrase
Messages postés937Date d'inscriptionlundi 19 janvier 2004StatutMembreDernière intervention 9 mai 2022
-
17 mars 2006 à 00:10
Bonjour
Je travail avec vba et je voulais savoir si il était possible de rajouter une icone dans la barre de titre de mon userform, et si c'est possible comment je doit faire?
valtrase
Messages postés937Date d'inscriptionlundi 19 janvier 2004StatutMembreDernière intervention 9 mai 20223 17 mars 2006 à 00:10
Lut,
J'ai trouvé ça pas testé par contre .....
'le code est à recopier dans le module de code d'un Userform
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" _
(ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function SendMessageA Lib "user32" _
(ByVal hwnd As Long, ByVal wMsg As Long, _
ByVal wParam As Integer, ByVal lParam As Long) As Long
Private Declare Function ExtractIconA Lib "shell32.dll" _
(ByVal hInst As Long, ByVal lpszExeFileName As String, _
ByVal nIconIndex As Long) As Long
Private Sub UserForm_Initialize()
Const IcoPath As String = "D:\Cheni2001\Icones\bebox\Clock.ico"
Dim hIcon As Long
hIcon = Len(Dir(IcoPath))
If hIcon = 0 Then Exit Sub
hIcon = ExtractIconA(0, IcoPath, 0)
SendMessageA FindWindow(vbNullString, Me.Caption), &H80, False, hIcon
End Sub