~ Edito ~
12/03/2006 @ 13:39
Depuis la dernière mise à jour (qui remonte à... oulala plusieurs mois), un petit ménage de printemps s'impose. Ca tombe bien, c'est presque la période. Au menu, et progressivement sur les jours à venir, rafraîchissement de plusieurs fonctions et procédures, nouvelles APIs et nouveaux programmes. ~ Rechercher ~
~ Annuaire VB ~
~ Partenaires ~
|
Fonction : GetTVColour (ByVal hwnd As Long, ByVal wMsg As Long, _ ByVal wParam As Long, ByVal lParam As Long) As Long Public Declare Function GetSysColor Lib "user32" (ByVal nIndex As Long) As Long Public Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" _ (ByVal hwnd As Long, ByVal nIndex As Long) As Long Public Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" _ (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long Public Const GWL_STYLE As Long = -16& Public Const COLOR_WINDOW = 5 Public Const COLOR_WINDOWTEXT = 8 Public Const TVS_HASLINES As Long = 2 Public Const TV_FIRST As Long = &H1100 Public Const TVM_SETBKCOLOR As Long = (TV_FIRST + 29) Public Const TVM_SETTEXTCOLOR As Long = (TV_FIRST + 30) Public Const TVM_GETBKCOLOR As Long = (TV_FIRST + 31) Public Const TVM_GETTEXTCOLOR As Long = (TV_FIRST + 32) Public Function GetTVColour(hwndTV As Long, Optional blBackColour As Boolean = True) As Long ' Récupère la couleur de fond, ou du texte, du treeview dont le Handle est passé en paramêtre. Dim lgClrref As Long If blBackColour Then lgClrref = SendMessageLong(hwndTV, TVM_GETBKCOLOR, 0, 0) Else lgClrref = SendMessageLong(hwndTV, TVM_GETTEXTCOLOR, 0, 0) End If If lgClrref = -1 Then If blBackColour Then lgClrref = GetSysColor(COLOR_WINDOW) Else lgClrref = GetSysColor(COLOR_WINDOWTEXT) End If End If ' Retourne la couleur GetTVColour = lgClrref End Function |