Cr�e un contr�le ListView
#include <GuiListView.au3>
_GUICtrlListView_Create ( $hWnd, $sHeaderText, $iX, $iY [, $iWidth = 150 [, $iHeight = 150 [, $iStyle = 0x0000000D [, $iExStyle = 0x00000000 [, $bCoInit = False]]]]] )
$hWnd | Handle du parent ou du propri�taire de la fen�tre |
$sHeaderText | Texte � afficher dans l'en-t�te. D�limiteur: "|" |
$iX | Position horizontale du contr�le |
$iY | Position verticale du contr�le |
$iWidth | [optionnel] Largeur du contr�le |
$iHeight | [optionnel] Hauteur du contr�le |
$iStyle | [optionnel] Styles du contr�le: $LVS_ALIGNLEFT - Les �l�ments sont align�s � gauche dans le mode d'affichage avec ic�nes et petites ic�nes $LVS_ALIGNTOP - Les �l�ments sont align�s en haut du contr�le dans le mode d'affichage avec ic�nes et petites ic�nes $LVS_AUTOARRANGE - Les ic�nes sont automatiquement gard�es arrang�es dans le mode d'affichage avec ic�nes et petites ic�nes $LVS_EDITLABELS - Le texte des �l�ments peut �tre modifi� en place $LVS_ICON - Ce style sp�cifie le mode d'affichage avec ic�ne $LVS_LIST - Ce style sp�cifie le mode d'affichage en liste $LVS_NOCOLUMNHEADER - L'en-t�te des colonnes n'est pas affich� dans le mode d'affichage en rapport $LVS_NOLABELWRAP - Le texte des �l�ments est affich� sur une seule ligne dans le mode d'affichage avec ic�nes $LVS_NOSCROLL - Le d�filement est d�sactiv� $LVS_NOSORTHEADER - L'en-t�te des colonnes ne fonctionnent pas comme des boutons $LVS_OWNERDATA - Ce style sp�cifie un contr�le virtuel $LVS_OWNERDRAWFIXED - La fen�tre propri�taire peut peindre les �l�ments dans le mode d'affichage en rapport $LVS_REPORT - Ce style sp�cifie le mode d'affichage en rapport $LVS_SHAREIMAGELISTS - La liste d'images ne sera pas supprim�e $LVS_SHOWSELALWAYS - La s�lection, le cas �ch�ant, est toujours affich�e $LVS_SINGLESEL - Un seul �l�ment � la fois peut �tre s�lectionn� $LVS_SMALLICON - Ce style sp�cifie le mode d'affichage avec petites ic�nes $LVS_SORTASCENDING - Les index des �l�ments sont tri�s en ordre croissant $LVS_SORTDESCENDING - Les index des �l�ments sont tri�s en ordre d�croissant Par d�faut: $LVS_REPORT, $LVS_SINGLESEL, $LVS_SHOWSELALWAYS Forc�: $WS_CHILD, $WS_VISIBLE |
$iExStyle | [optionnel] Styles �tendus du contr�le. La valeur peut �tre une combinaison des �l�ments suivants: $LVS_EX_BORDERSELECT - Quand un �l�ment est s�lectionn�, la couleur de la bordure de l'�l�ment change $LVS_EX_CHECKBOXES - Permet des cases � cocher pour les �l�ments dans un contr�le ListView $LVS_EX_DOUBLEBUFFER - La peinture se fait avec une double m�moire tampon, ce qui r�duit le scintillement $LVS_EX_FLATSB - Permet des barres de d�filement sans relief dans la ListView $LVS_EX_FULLROWSELECT - Quand un �l�ment est s�lectionn�, l'�l�ment et tous ses sous-�l�ments sont surlign�s $LVS_EX_GRIDLINES- Affiche un quadrillage autour des �l�ments et des sous-�l�ments $LVS_EX_HEADERDRAGDROP - Permet la r�organisation des colonnes par tirer-d�poser $LVS_EX_INFOTIP - Le message de notification $LVN_GETINFOTIP est envoy� avant d'afficher une info-bulle $LVS_EX_LABELTIP - S'il n'est pas install�, les �tiquettes sont partiellement cach�es, seulement pour la pr�sentation avec grande ic�ne $LVS_EX_MULTIWORKAREAS - Le contr�le n'arrangera pas ses ic�nes jusqu'� ce que une ou plusieurs zones de travail soient d�finies $LVS_EX_ONECLICKACTIVATE - Le contr�le envoie un message $LVN_ITEMACTIVATE lorsque l'utilisateur clique sur un �l�ment $LVS_EX_REGIONAL - D�finit la zone de contr�le pour inclure uniquement l'ic�ne et le texte des �l�ments $LVS_EX_SIMPLESELECT - Dans le mode d'affichage avec ic�nes, d�place l'image de l'�tat du contr�le en haut � droite $LVS_EX_SUBITEMIMAGES - Permet l'affichage des images pour les sous-�l�ments $LVS_EX_TRACKSELECT - Permet la s�lection � chaud dans le contr�le $LVS_EX_TWOCLICKACTIVATE - Le contr�le envoie un message $LVN_ITEMACTIVATE lorsque l'utilisateur double-clique sur un �l�ment $LVS_EX_UNDERLINECOLD - Les �l�ments 'non-hot' pouvant �tre activ�s seront affich�s en surlign� $LVS_EX_UNDERLINEHOT - Les �l�ments 'hot' pouvant �tre activ�s seront affich�s en surlign� |
$bCoInit | [optionnel] Initialise la biblioth�que COM pour une utilisation par le thread appelant. |
Succ�s: | Retourne le handle du contr�le ListBox. |
�chec: | Retourne 0 et d�finit @error <> 0. |
@error: | 1 - Handle de fen�tre non valide 2 - Le texte d'en-t�te n'est pas une cha�ne |
Cette fonction est destin�e aux utilisateurs avertis et � ceux qui veulent comprendre comment fonctionne le contr�le.
_GUICtrlListView_Destroy, _GUICtrlListView_SetBkImage
#include <GUIConstantsEx.au3> #include <GuiImageList.au3> #include <GuiListView.au3> #include <WindowsConstants.au3> Global $g_hListView Example() Func Example() Local $hGUI, $hImage $hGUI = GUICreate("(UDF Created) ListView Create", 400, 300) $g_hListView = _GUICtrlListView_Create($hGUI, "", 2, 2, 394, 268) _GUICtrlListView_SetExtendedListViewStyle($g_hListView, BitOR($LVS_EX_GRIDLINES, $LVS_EX_FULLROWSELECT, $LVS_EX_SUBITEMIMAGES)) GUISetState(@SW_SHOW) GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY") ; Charge des images $hImage = _GUIImageList_Create() _GUIImageList_Add($hImage, _GUICtrlListView_CreateSolidBitMap($g_hListView, 0xFF0000, 16, 16)) _GUIImageList_Add($hImage, _GUICtrlListView_CreateSolidBitMap($g_hListView, 0x00FF00, 16, 16)) _GUIImageList_Add($hImage, _GUICtrlListView_CreateSolidBitMap($g_hListView, 0x0000FF, 16, 16)) _GUICtrlListView_SetImageList($g_hListView, $hImage, 1) ; Ajoute des colonnes _GUICtrlListView_InsertColumn($g_hListView, 0, "Column 1", 100) _GUICtrlListView_InsertColumn($g_hListView, 1, "Column 2", 100) _GUICtrlListView_InsertColumn($g_hListView, 2, "Column 3", 100) ; Ajoute des �l�ments _GUICtrlListView_AddItem($g_hListView, "Row 1: Col 1", 0) _GUICtrlListView_AddSubItem($g_hListView, 0, "Row 1: Col 2", 1) _GUICtrlListView_AddSubItem($g_hListView, 0, "Row 1: Col 3", 2) _GUICtrlListView_AddItem($g_hListView, "Row 2: Col 1", 1) _GUICtrlListView_AddSubItem($g_hListView, 1, "Row 2: Col 2", 1) _GUICtrlListView_AddItem($g_hListView, "Row 3: Col 1", 2) ; Boucle jusqu'� ce que l'utilisateur quitte. Do Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete() EndFunc ;==>Example Func WM_NOTIFY($hWnd, $iMsg, $wParam, $lParam) #forceref $hWnd, $iMsg, $wParam Local $hWndFrom, $iIDFrom, $iCode, $tNMHDR, $hWndListView, $tInfo ; Local $tBuffer $hWndListView = $g_hListView If Not IsHWnd($g_hListView) Then $hWndListView = GUICtrlGetHandle($g_hListView) $tNMHDR = DllStructCreate($tagNMHDR, $lParam) $hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom")) $iIDFrom = DllStructGetData($tNMHDR, "IDFrom") $iCode = DllStructGetData($tNMHDR, "Code") Switch $hWndFrom Case $hWndListView Switch $iCode ; Case $LVN_BEGINDRAG ; Une op�ration de glisser-d�poser impliquant le bouton gauche de la souris est lanc�e ; $tInfo = DllStructCreate($tagNMLISTVIEW, $lParam) ; _DebugPrint("$LVN_BEGINDRAG" & @CRLF & "--> hWndFrom:" & @TAB & $hWndFrom & @CRLF & _ ; "-->IDFrom:" & @TAB & $iIDFrom & @CRLF & _ ; "-->Code:" & @TAB & $iCode & @CRLF & _ ; "-->Item:" & @TAB & DllStructGetData($tInfo, "Item") & @CRLF & _ ; "-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @CRLF & _ ; "-->NewState:" & @TAB & DllStructGetData($tInfo, "NewState") & @CRLF & _ ; "-->OldState:" & @TAB & DllStructGetData($tInfo, "OldState") & @CRLF & _ ; "-->Changed:" & @TAB & DllStructGetData($tInfo, "Changed") & @CRLF & _ ; "-->ActionX:" & @TAB & DllStructGetData($tInfo, "ActionX") & @CRLF & _ ; "-->ActionY:" & @TAB & DllStructGetData($tInfo, "ActionY") & @CRLF & _ ; "-->Param:" & @TAB & DllStructGetData($tInfo, "Param")) ; ; Aucune valeur retourn�e ; Case $LVN_BEGINLABELEDIT ; D�marre l'�dition d'une �tiquette d'un �l�ment ; $tInfo = DllStructCreate($tagNMLVDISPINFO, $lParam) ; _DebugPrint("$LVN_BEGINLABELEDIT" & @CRLF & "--> hWndFrom:" & @TAB & $hWndFrom & @CRLF & _ ; "-->IDFrom:" & @TAB & $iIDFrom & @CRLF & _ ; "-->Code:" & @TAB & $iCode & @CRLF & _ ; "-->Mask:" & @TAB & DllStructGetData($tInfo, "Mask") & @CRLF & _ ; "-->Item:" & @TAB & DllStructGetData($tInfo, "Item") & @CRLF & _ ; "-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @CRLF & _ ; "-->State:" & @TAB & DllStructGetData($tInfo, "State") & @CRLF & _ ; "-->StateMask:" & @TAB & DllStructGetData($tInfo, "StateMask") & @CRLF & _ ; "-->Image:" & @TAB & DllStructGetData($tInfo, "Image") & @CRLF & _ ; "-->Param:" & @TAB & DllStructGetData($tInfo, "Param") & @CRLF & _ ; "-->Indent:" & @TAB & DllStructGetData($tInfo, "Indent") & @CRLF & _ ; "-->GroupID:" & @TAB & DllStructGetData($tInfo, "GroupID") & @CRLF & _ ; "-->Columns:" & @TAB & DllStructGetData($tInfo, "Columns") & @CRLF & _ ; "-->pColumns:" & @TAB & DllStructGetData($tInfo, "pColumns")) ; Return False ; Autorise l'utilisateur de modifier l'�tiquette ; ; Return True ; Emp�che l'utilisateur de modifier l'�tiquette ; Case $LVN_BEGINRDRAG ; Une op�ration glisser-d�poser impliquant le bouton droit de la souris est en train d'�tre initialis� ; $tInfo = DllStructCreate($tagNMLISTVIEW, $lParam) ; _DebugPrint("$LVN_BEGINRDRAG" & @CRLF & "--> hWndFrom:" & @TAB & $hWndFrom & @CRLF & _ ; "-->IDFrom:" & @TAB & $iIDFrom & @CRLF & _ ; "-->Code:" & @TAB & $iCode & @CRLF & _ ; "-->Item:" & @TAB & DllStructGetData($tInfo, "Item") & @CRLF & _ ; "-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @CRLF & _ ; "-->NewState:" & @TAB & DllStructGetData($tInfo, "NewState") & @CRLF & _ ; "-->OldState:" & @TAB & DllStructGetData($tInfo, "OldState") & @CRLF & _ ; "-->Changed:" & @TAB & DllStructGetData($tInfo, "Changed") & @CRLF & _ ; "-->ActionX:" & @TAB & DllStructGetData($tInfo, "ActionX") & @CRLF & _ ; "-->ActionY:" & @TAB & DllStructGetData($tInfo, "ActionY") & @CRLF & _ ; "-->Param:" & @TAB & DllStructGetData($tInfo, "Param")) ; ; Aucune valeur retourn�e ; Case $LVN_BEGINSCROLL ; Une op�ration de d�filement d�marre, Minium OS WinXP ; $tInfo = DllStructCreate($tagNMLVSCROLL, $lParam) ; _DebugPrint("$LVN_BEGINSCROLL" & @CRLF & "--> hWndFrom:" & @TAB & $hWndFrom & @CRLF & _ ; "-->IDFrom:" & @TAB & $iIDFrom & @CRLF & _ ; "-->Code:" & @TAB & $iCode & @CRLF & _ ; "-->DX:" & @TAB & DllStructGetData($tInfo, "DX") & @CRLF & _ ; "-->DY:" & @TAB & DllStructGetData($tInfo, "DY")) ; ; Aucune valeur retourn�e Case $LVN_COLUMNCLICK ; Une colonne a �t� cliqu�e $tInfo = DllStructCreate($tagNMLISTVIEW, $lParam) _DebugPrint("$LVN_COLUMNCLICK" & @CRLF & "--> hWndFrom:" & @TAB & $hWndFrom & @CRLF & _ "-->IDFrom:" & @TAB & $iIDFrom & @CRLF & _ "-->Code:" & @TAB & $iCode & @CRLF & _ "-->Item:" & @TAB & DllStructGetData($tInfo, "Item") & @CRLF & _ "-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @CRLF & _ "-->NewState:" & @TAB & DllStructGetData($tInfo, "NewState") & @CRLF & _ "-->OldState:" & @TAB & DllStructGetData($tInfo, "OldState") & @CRLF & _ "-->Changed:" & @TAB & DllStructGetData($tInfo, "Changed") & @CRLF & _ "-->ActionX:" & @TAB & DllStructGetData($tInfo, "ActionX") & @CRLF & _ "-->ActionY:" & @TAB & DllStructGetData($tInfo, "ActionY") & @CRLF & _ "-->Param:" & @TAB & DllStructGetData($tInfo, "Param")) ; Aucune valeur retourn�e ; Case $LVN_DELETEALLITEMS ; Tous les �l�ments du contr�le sont sur le point d'�tre supprim�s ; $tInfo = DllStructCreate($tagNMLISTVIEW, $lParam) ; _DebugPrint("$LVN_DELETEALLITEMS" & @CRLF & "--> hWndFrom:" & @TAB & $hWndFrom & @CRLF & _ ; "-->IDFrom:" & @TAB & $iIDFrom & @CRLF & _ ; "-->Code:" & @TAB & $iCode & @CRLF & _ ; "-->Item:" & @TAB & DllStructGetData($tInfo, "Item") & @CRLF & _ ; "-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @CRLF & _ ; "-->NewState:" & @TAB & DllStructGetData($tInfo, "NewState") & @CRLF & _ ; "-->OldState:" & @TAB & DllStructGetData($tInfo, "OldState") & @CRLF & _ ; "-->Changed:" & @TAB & DllStructGetData($tInfo, "Changed") & @CRLF & _ ; "-->ActionX:" & @TAB & DllStructGetData($tInfo, "ActionX") & @CRLF & _ ; "-->ActionY:" & @TAB & DllStructGetData($tInfo, "ActionY") & @CRLF & _ ; "-->Param:" & @TAB & DllStructGetData($tInfo, "Param")) ; Return True ; Pour supprimer les messages ult�rieurs $LVN_DeleteItem ; ; Return False ; Pour recevoir ult�rieurement les messages $LVN_DELETEITEM ; Case $LVN_DELETEITEM ; Un �l�ment est sur le point d'�tre effac� ; $tInfo = DllStructCreate($tagNMLISTVIEW, $lParam) ; _DebugPrint("$LVN_DELETEITEM" & @CRLF & "--> hWndFrom:" & @TAB & $hWndFrom & @CRLF & _ ; "-->IDFrom:" & @TAB & $iIDFrom & @CRLF & _ ; "-->Code:" & @TAB & $iCode & @CRLF & _ ; "-->Item:" & @TAB & DllStructGetData($tInfo, "Item") & @CRLF & _ ; "-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @CRLF & _ ; "-->NewState:" & @TAB & DllStructGetData($tInfo, "NewState") & @CRLF & _ ; "-->OldState:" & @TAB & DllStructGetData($tInfo, "OldState") & @CRLF & _ ; "-->Changed:" & @TAB & DllStructGetData($tInfo, "Changed") & @CRLF & _ ; "-->ActionX:" & @TAB & DllStructGetData($tInfo, "ActionX") & @CRLF & _ ; "-->ActionY:" & @TAB & DllStructGetData($tInfo, "ActionY") & @CRLF & _ ; "-->Param:" & @TAB & DllStructGetData($tInfo, "Param")) ; ; No return value ; Case $LVN_ENDLABELEDIT ; La fin de l'�dition d'une �tiquette pour un �l�ment ; $tInfo = DllStructCreate($tagNMLVDISPINFO, $lParam) ; $tBuffer = DllStructCreate("char Text[" & DllStructGetData($tInfo, "TextMax") & "]", DllStructGetData($tInfo, "Text")) ; _DebugPrint("$LVN_ENDLABELEDIT" & @CRLF & "--> hWndFrom:" & @TAB & $hWndFrom & @CRLF & _ ; "-->IDFrom:" & @TAB & $iIDFrom & @CRLF & _ ; "-->Code:" & @TAB & $iCode & @CRLF & _ ; "-->Mask:" & @TAB & DllStructGetData($tInfo, "Mask") & @CRLF & _ ; "-->Item:" & @TAB & DllStructGetData($tInfo, "Item") & @CRLF & _ ; "-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @CRLF & _ ; "-->State:" & @TAB & DllStructGetData($tInfo, "State") & @CRLF & _ ; "-->StateMask:" & @TAB & DllStructGetData($tInfo, "StateMask") & @CRLF & _ ; "-->Text:" & @TAB & DllStructGetData($tBuffer, "Text") & @CRLF & _ ; "-->TextMax:" & @TAB & DllStructGetData($tInfo, "TextMax") & @CRLF & _ ; "-->Image:" & @TAB & DllStructGetData($tInfo, "Image") & @CRLF & _ ; "-->Param:" & @TAB & DllStructGetData($tInfo, "Param") & @CRLF & _ ; "-->Indent:" & @TAB & DllStructGetData($tInfo, "Indent") & @CRLF & _ ; "-->GroupID:" & @TAB & DllStructGetData($tInfo, "GroupID") & @CRLF & _ ; "-->Columns:" & @TAB & DllStructGetData($tInfo, "Columns") & @CRLF & _ ; "-->pColumns:" & @TAB & DllStructGetData($tInfo, "pColumns")) ; ; Si Text n'est pas vide, retourne True pour d�finir l'�tiquette de l'�l�ment avec le texte �dit�, retourne false pour le rejeter ; ; Si Text est vide la valeur retourn�e est ignor�e ; Return True ; Case $LVN_ENDSCROLL ; Une op�ration de d�filement se termine, Minimum OS WinXP ; $tInfo = DllStructCreate($tagNMLVSCROLL, $lParam) ; _DebugPrint("$LVN_ENDSCROLL" & @CRLF & "--> hWndFrom:" & @TAB & $hWndFrom & @CRLF & _ ; "-->IDFrom:" & @TAB & $iIDFrom & @CRLF & _ ; "-->Code:" & @TAB & $iCode & @CRLF & _ ; "-->DX:" & @TAB & DllStructGetData($tInfo, "DX") & @CRLF & _ ; "-->DY:" & @TAB & DllStructGetData($tInfo, "DY")) ; ; Aucune valeur retourn�e ; Case $LVN_GETDISPINFO ; Fournit les informations n�cessaires pour afficher ou trier les �l�ments d'un ListView ; $tInfo = DllStructCreate($tagNMLVDISPINFO, $lParam) ; $tBuffer = DllStructCreate("char Text[" & DllStructGetData($tInfo, "TextMax") & "]", DllStructGetData($tInfo, "Text")) ; _DebugPrint("$LVN_GETDISPINFO" & @CRLF & "--> hWndFrom:" & @TAB & $hWndFrom & @CRLF & _ ; "-->IDFrom:" & @TAB & $iIDFrom & @CRLF & _ ; "-->Code:" & @TAB & $iCode & @CRLF & _ ; "-->Mask:" & @TAB & DllStructGetData($tInfo, "Mask") & @CRLF & _ ; "-->Item:" & @TAB & DllStructGetData($tInfo, "Item") & @CRLF & _ ; "-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @CRLF & _ ; "-->State:" & @TAB & DllStructGetData($tInfo, "State") & @CRLF & _ ; "-->StateMask:" & @TAB & DllStructGetData($tInfo, "StateMask") & @CRLF & _ ; "-->Text:" & @TAB & DllStructGetData($tBuffer, "Text") & @CRLF & _ ; "-->TextMax:" & @TAB & DllStructGetData($tInfo, "TextMax") & @CRLF & _ ; "-->Image:" & @TAB & DllStructGetData($tInfo, "Image") & @CRLF & _ ; "-->Param:" & @TAB & DllStructGetData($tInfo, "Param") & @CRLF & _ ; "-->Indent:" & @TAB & DllStructGetData($tInfo, "Indent") & @CRLF & _ ; "-->GroupID:" & @TAB & DllStructGetData($tInfo, "GroupID") & @CRLF & _ ; "-->Columns:" & @TAB & DllStructGetData($tInfo, "Columns") & @CRLF & _ ; "-->pColumns:" & @TAB & DllStructGetData($tInfo, "pColumns")) ; ; Aucune valeur retourn�e ; Case $LVN_GETINFOTIP ; Envoy� par un contr�le ListView de style large ic�ne qui a le style �tendu $LVS_EX_INFOTIP ; $tInfo = DllStructCreate($tagNMLVGETINFOTIP, $lParam) ; $tBuffer = DllStructCreate("char Text[" & DllStructGetData($tInfo, "TextMax") & "]", DllStructGetData($tInfo, "Text")) ; _DebugPrint("$LVN_GETINFOTIP" & @CRLF & "--> hWndFrom:" & @TAB & $hWndFrom & @CRLF & _ ; "-->IDFrom:" & @TAB & $iIDFrom & @CRLF & _ ; "-->Code:" & @TAB & $iCode & @CRLF & _ ; "-->Flags:" & @TAB & DllStructGetData($tInfo, "Flags") & @CRLF & _ ; "-->Text:" & @TAB & DllStructGetData($tBuffer, "Text") & @CRLF & _ ; "-->TextMax:" & @TAB & DllStructGetData($tInfo, "TextMax") & @CRLF & _ ; "-->Item:" & @TAB & DllStructGetData($tInfo, "Item") & @CRLF & _ ; "-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @CRLF & _ ; "-->lParam:" & @TAB & DllStructGetData($tInfo, "lParam")) ; ; -No return value ; Case $LVN_HOTTRACK ; Envoy� par un contr�le ListView quand l'utilisateur d�place la souris sur l'�l�ment ; $tInfo = DllStructCreate($tagNMLISTVIEW, $lParam) ; _DebugPrint("$LVN_HOTTRACK" & @CRLF & "--> hWndFrom:" & @TAB & $hWndFrom & @CRLF & _ ; "-->IDFrom:" & @TAB & $iIDFrom & @CRLF & _ ; "-->Code:" & @TAB & $iCode & @CRLF & _ ; "-->Item:" & @TAB & DllStructGetData($tInfo, "Item") & @CRLF & _ ; "-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @CRLF & _ ; "-->NewState:" & @TAB & DllStructGetData($tInfo, "NewState") & @CRLF & _ ; "-->OldState:" & @TAB & DllStructGetData($tInfo, "OldState") & @CRLF & _ ; "-->Changed:" & @TAB & DllStructGetData($tInfo, "Changed") & @CRLF & _ ; "-->ActionX:" & @TAB & DllStructGetData($tInfo, "ActionX") & @CRLF & _ ; "-->ActionY:" & @TAB & DllStructGetData($tInfo, "ActionY") & @CRLF & _ ; "-->Param:" & @TAB & DllStructGetData($tInfo, "Param")) ; Return 0 ; allow the list view to perform its normal track select processing. ; ; Return 1 ; L'�l�ment ne sera pas s�lectionn�. ; Case $LVN_INSERTITEM ; Un nouvel �l�ment a �t� ins�r� ; $tInfo = DllStructCreate($tagNMLISTVIEW, $lParam) ; _DebugPrint("$LVN_INSERTITEM" & @CRLF & "--> hWndFrom:" & @TAB & $hWndFrom & @CRLF & _ ; "-->IDFrom:" & @TAB & $iIDFrom & @CRLF & _ ; "-->Code:" & @TAB & $iCode & @CRLF & _ ; "-->Item:" & @TAB & DllStructGetData($tInfo, "Item") & @CRLF & _ ; "-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @CRLF & _ ; "-->NewState:" & @TAB & DllStructGetData($tInfo, "NewState") & @CRLF & _ ; "-->OldState:" & @TAB & DllStructGetData($tInfo, "OldState") & @CRLF & _ ; "-->Changed:" & @TAB & DllStructGetData($tInfo, "Changed") & @CRLF & _ ; "-->ActionX:" & @TAB & DllStructGetData($tInfo, "ActionX") & @CRLF & _ ; "-->ActionY:" & @TAB & DllStructGetData($tInfo, "ActionY") & @CRLF & _ ; "-->Param:" & @TAB & DllStructGetData($tInfo, "Param")) ; ; Aucune valeur retourn�e ; Case $LVN_ITEMACTIVATE ; Envoy� par un contr�le ListView quand l'utilisateur active un �l�ment ; $tInfo = DllStructCreate($tagNMITEMACTIVATE, $lParam) ; _DebugPrint("$LVN_ITEMACTIVATE" & @CRLF & "--> hWndFrom:" & @TAB & $hWndFrom & @CRLF & _ ; "-->IDFrom:" & @TAB & $iIDFrom & @CRLF & _ ; "-->Code:" & @TAB & $iCode & @CRLF & _ ; "-->Index:" & @TAB & DllStructGetData($tInfo, "Index") & @CRLF & _ ; "-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @CRLF & _ ; "-->NewState:" & @TAB & DllStructGetData($tInfo, "NewState") & @CRLF & _ ; "-->OldState:" & @TAB & DllStructGetData($tInfo, "OldState") & @CRLF & _ ; "-->Changed:" & @TAB & DllStructGetData($tInfo, "Changed") & @CRLF & _ ; "-->ActionX:" & @TAB & DllStructGetData($tInfo, "ActionX") & @CRLF & _ ; "-->ActionY:" & @TAB & DllStructGetData($tInfo, "ActionY") & @CRLF & _ ; "-->lParam:" & @TAB & DllStructGetData($tInfo, "lParam") & @CRLF & _ ; "-->KeyFlags:" & @TAB & DllStructGetData($tInfo, "KeyFlags")) ; Return 0 ; Case $LVN_ITEMCHANGED ; Un �l�ment a chang� ; $tInfo = DllStructCreate($tagNMLISTVIEW, $lParam) ; _DebugPrint("$LVN_ITEMCHANGED" & @CRLF & "--> hWndFrom:" & @TAB & $hWndFrom & @CRLF & _ ; "-->IDFrom:" & @TAB & $iIDFrom & @CRLF & _ ; "-->Code:" & @TAB & $iCode & @CRLF & _ ; "-->Item:" & @TAB & DllStructGetData($tInfo, "Item") & @CRLF & _ ; "-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @CRLF & _ ; "-->NewState:" & @TAB & DllStructGetData($tInfo, "NewState") & @CRLF & _ ; "-->OldState:" & @TAB & DllStructGetData($tInfo, "OldState") & @CRLF & _ ; "-->Changed:" & @TAB & DllStructGetData($tInfo, "Changed") & @CRLF & _ ; "-->ActionX:" & @TAB & DllStructGetData($tInfo, "ActionX") & @CRLF & _ ; "-->ActionY:" & @TAB & DllStructGetData($tInfo, "ActionY") & @CRLF & _ ; "-->Param:" & @TAB & DllStructGetData($tInfo, "Param")) ; ; Aucune valeur retourn�e ; Case $LVN_ITEMCHANGING ; Un �l�ment est en train de changer ; $tInfo = DllStructCreate($tagNMLISTVIEW, $lParam) ; _DebugPrint("$LVN_ITEMCHANGING" & @CRLF & "--> hWndFrom:" & @TAB & $hWndFrom & @CRLF & _ ; "-->IDFrom:" & @TAB & $iIDFrom & @CRLF & _ ; "-->Code:" & @TAB & $iCode & @CRLF & _ ; "-->Item:" & @TAB & DllStructGetData($tInfo, "Item") & @CRLF & _ ; "-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @CRLF & _ ; "-->NewState:" & @TAB & DllStructGetData($tInfo, "NewState") & @CRLF & _ ; "-->OldState:" & @TAB & DllStructGetData($tInfo, "OldState") & @CRLF & _ ; "-->Changed:" & @TAB & DllStructGetData($tInfo, "Changed") & @CRLF & _ ; "-->ActionX:" & @TAB & DllStructGetData($tInfo, "ActionX") & @CRLF & _ ; "-->ActionY:" & @TAB & DllStructGetData($tInfo, "ActionY") & @CRLF & _ ; "-->Param:" & @TAB & DllStructGetData($tInfo, "Param")) ; Return True ; prevent the change ; ; Return False ; Autorise le changement Case $LVN_KEYDOWN ; Une touche a �t� press�e $tInfo = DllStructCreate($tagNMLVKEYDOWN, $lParam) _DebugPrint("$LVN_KEYDOWN" & @CRLF & "--> hWndFrom:" & @TAB & $hWndFrom & @CRLF & _ "-->IDFrom:" & @TAB & $iIDFrom & @CRLF & _ "-->Code:" & @TAB & $iCode & @CRLF & _ "-->VKey:" & @TAB & DllStructGetData($tInfo, "VKey") & @CRLF & _ "-->Flags:" & @TAB & DllStructGetData($tInfo, "Flags")) ; Aucune valeur retourn�e ; Case $LVN_MARQUEEBEGIN ; La s�lection d'un cadre de d�limitation a commenc� ; _DebugPrint("$LVN_MARQUEEBEGIN" & @CRLF & "--> hWndFrom:" & @TAB & $hWndFrom & @CRLF & _ ; "-->IDFrom:" & @TAB & $iIDFrom & @CRLF & _ ; "-->Code:" & @TAB & $iCode) ; Return 0 ; Accepte le message ; ; Return 1 ; Arr�te la s�lection du cadre de d�limitation ; Case $LVN_SETDISPINFO ; Met � jour les informations qu'il conserve pour un �l�ment ; $tInfo = DllStructCreate($tagNMLVDISPINFO, $lParam) ; $tBuffer = DllStructCreate("char Text[" & DllStructGetData($tInfo, "TextMax") & "]", DllStructGetData($tInfo, "Text")) ; _DebugPrint("$LVN_SETDISPINFO" & @CRLF & "--> hWndFrom:" & @TAB & $hWndFrom & @CRLF & _ ; "-->IDFrom:" & @TAB & $iIDFrom & @CRLF & _ ; "-->Code:" & @TAB & $iCode & @CRLF & _ ; "-->Mask:" & @TAB & DllStructGetData($tInfo, "Mask") & @CRLF & _ ; "-->Item:" & @TAB & DllStructGetData($tInfo, "Item") & @CRLF & _ ; "-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @CRLF & _ ; "-->State:" & @TAB & DllStructGetData($tInfo, "State") & @CRLF & _ ; "-->StateMask:" & @TAB & DllStructGetData($tInfo, "StateMask") & @CRLF & _ ; "-->Text:" & @TAB & DllStructGetData($tBuffer, "Text") & @CRLF & _ ; "-->TextMax:" & @TAB & DllStructGetData($tInfo, "TextMax") & @CRLF & _ ; "-->Image:" & @TAB & DllStructGetData($tInfo, "Image") & @CRLF & _ ; "-->Param:" & @TAB & DllStructGetData($tInfo, "Param") & @CRLF & _ ; "-->Indent:" & @TAB & DllStructGetData($tInfo, "Indent") & @CRLF & _ ; "-->GroupID:" & @TAB & DllStructGetData($tInfo, "GroupID") & @CRLF & _ ; "-->Columns:" & @TAB & DllStructGetData($tInfo, "Columns") & @CRLF & _ ; "-->pColumns:" & @TAB & DllStructGetData($tInfo, "pColumns")) ; ; Aucune valeur retourn�e Case $NM_CLICK ; Envoy� par un contr�le ListView quand l'utillisateur clique sur un �l�ment avec le bouton gauche de la souris $tInfo = DllStructCreate($tagNMITEMACTIVATE, $lParam) _DebugPrint("$NM_CLICK" & @CRLF & "--> hWndFrom:" & @TAB & $hWndFrom & @CRLF & _ "-->IDFrom:" & @TAB & $iIDFrom & @CRLF & _ "-->Code:" & @TAB & $iCode & @CRLF & _ "-->Index:" & @TAB & DllStructGetData($tInfo, "Index") & @CRLF & _ "-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @CRLF & _ "-->NewState:" & @TAB & DllStructGetData($tInfo, "NewState") & @CRLF & _ "-->OldState:" & @TAB & DllStructGetData($tInfo, "OldState") & @CRLF & _ "-->Changed:" & @TAB & DllStructGetData($tInfo, "Changed") & @CRLF & _ "-->ActionX:" & @TAB & DllStructGetData($tInfo, "ActionX") & @CRLF & _ "-->ActionY:" & @TAB & DllStructGetData($tInfo, "ActionY") & @CRLF & _ "-->lParam:" & @TAB & DllStructGetData($tInfo, "lParam") & @CRLF & _ "-->KeyFlags:" & @TAB & DllStructGetData($tInfo, "KeyFlags")) ; Aucune valeur retourn�e Case $NM_DBLCLK ; Envoy� par un contr�le ListView quand l'utilisateur double-clique sur un �l�ment avec le bouton gauche de la souris $tInfo = DllStructCreate($tagNMITEMACTIVATE, $lParam) _DebugPrint("$NM_DBLCLK" & @CRLF & "--> hWndFrom:" & @TAB & $hWndFrom & @CRLF & _ "-->IDFrom:" & @TAB & $iIDFrom & @CRLF & _ "-->Code:" & @TAB & $iCode & @CRLF & _ "-->Index:" & @TAB & DllStructGetData($tInfo, "Index") & @CRLF & _ "-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @CRLF & _ "-->NewState:" & @TAB & DllStructGetData($tInfo, "NewState") & @CRLF & _ "-->OldState:" & @TAB & DllStructGetData($tInfo, "OldState") & @CRLF & _ "-->Changed:" & @TAB & DllStructGetData($tInfo, "Changed") & @CRLF & _ "-->ActionX:" & @TAB & DllStructGetData($tInfo, "ActionX") & @CRLF & _ "-->ActionY:" & @TAB & DllStructGetData($tInfo, "ActionY") & @CRLF & _ "-->lParam:" & @TAB & DllStructGetData($tInfo, "lParam") & @CRLF & _ "-->KeyFlags:" & @TAB & DllStructGetData($tInfo, "KeyFlags")) ; Aucune valeur retourn�e ; Case $NM_HOVER ; Envoy� par un contr�le ListView quand la souris survole un �l�ment ; _DebugPrint("$NM_HOVER" & @CRLF & "--> hWndFrom:" & @TAB & $hWndFrom & @CRLF & _ ; "-->IDFrom:" & @TAB & $iIDFrom & @CRLF & _ ; "-->Code:" & @TAB & $iCode) ; Return 0 ; traite le survol normalement ; ; Return 1 ; Emp�che le survol d'�tre trait� Case $NM_KILLFOCUS ; Le contr�le a perdu le focus d'entr�e _DebugPrint("$NM_KILLFOCUS" & @CRLF & "--> hWndFrom:" & @TAB & $hWndFrom & @CRLF & _ "-->IDFrom:" & @TAB & $iIDFrom & @CRLF & _ "-->Code:" & @TAB & $iCode) ; Aucune valeur retourn�e Case $NM_RCLICK ; Envoy� par un contr�le ListView quand l'utilisateur clique sur un �l�ment avec le bouton droit de la souris $tInfo = DllStructCreate($tagNMITEMACTIVATE, $lParam) _DebugPrint("$NM_RCLICK" & @CRLF & "--> hWndFrom:" & @TAB & $hWndFrom & @CRLF & _ "-->IDFrom:" & @TAB & $iIDFrom & @CRLF & _ "-->Code:" & @TAB & $iCode & @CRLF & _ "-->Index:" & @TAB & DllStructGetData($tInfo, "Index") & @CRLF & _ "-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @CRLF & _ "-->NewState:" & @TAB & DllStructGetData($tInfo, "NewState") & @CRLF & _ "-->OldState:" & @TAB & DllStructGetData($tInfo, "OldState") & @CRLF & _ "-->Changed:" & @TAB & DllStructGetData($tInfo, "Changed") & @CRLF & _ "-->ActionX:" & @TAB & DllStructGetData($tInfo, "ActionX") & @CRLF & _ "-->ActionY:" & @TAB & DllStructGetData($tInfo, "ActionY") & @CRLF & _ "-->lParam:" & @TAB & DllStructGetData($tInfo, "lParam") & @CRLF & _ "-->KeyFlags:" & @TAB & DllStructGetData($tInfo, "KeyFlags")) ; Return 1 ; pour interdire le traitement par d�faut Return 0 ; permet le traitement par d�faut Case $NM_RDBLCLK ; Envoy� par un contr�le ListView quand l'utilisateur double-clique sur un �l�ment avec le bouton droit de la souris $tInfo = DllStructCreate($tagNMITEMACTIVATE, $lParam) _DebugPrint("$NM_RDBLCLK" & @CRLF & "--> hWndFrom:" & @TAB & $hWndFrom & @CRLF & _ "-->IDFrom:" & @TAB & $iIDFrom & @CRLF & _ "-->Code:" & @TAB & $iCode & @CRLF & _ "-->Index:" & @TAB & DllStructGetData($tInfo, "Index") & @CRLF & _ "-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @CRLF & _ "-->NewState:" & @TAB & DllStructGetData($tInfo, "NewState") & @CRLF & _ "-->OldState:" & @TAB & DllStructGetData($tInfo, "OldState") & @CRLF & _ "-->Changed:" & @TAB & DllStructGetData($tInfo, "Changed") & @CRLF & _ "-->ActionX:" & @TAB & DllStructGetData($tInfo, "ActionX") & @CRLF & _ "-->ActionY:" & @TAB & DllStructGetData($tInfo, "ActionY") & @CRLF & _ "-->lParam:" & @TAB & DllStructGetData($tInfo, "lParam") & @CRLF & _ "-->KeyFlags:" & @TAB & DllStructGetData($tInfo, "KeyFlags")) ; Aucune valeur retourn�e Case $NM_RETURN ; Le contr�le a le focus et l'utilisateur a press� la touche ENTER _DebugPrint("$NM_RETURN" & @CRLF & "--> hWndFrom:" & @TAB & $hWndFrom & @CRLF & _ "-->IDFrom:" & @TAB & $iIDFrom & @CRLF & _ "-->Code:" & @TAB & $iCode) ; Aucune valeur retourn�e Case $NM_SETFOCUS ; Le contr�le a re�u le focus d'entr�e _DebugPrint("$NM_SETFOCUS" & @CRLF & "--> hWndFrom:" & @TAB & $hWndFrom & @CRLF & _ "-->IDFrom:" & @TAB & $iIDFrom & @CRLF & _ "-->Code:" & @TAB & $iCode) ; Aucune valeur retourn�e EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_NOTIFY Func _DebugPrint($s_Text, $sLine = @ScriptLineNumber) ConsoleWrite( _ "!===========================================================" & @CRLF & _ "+======================================================" & @CRLF & _ "-->Line(" & StringFormat("%04d", $sLine) & "):" & @TAB & $s_Text & @CRLF & _ "+======================================================" & @CRLF) EndFunc ;==>_DebugPrint