j'ai un problème de comprehension sur GUICtrlCreateList.
avant j'utilisai GUICtrlCreateEdit et chaque information allait à la ligne sans problème.
Maintenant je souhaite remplacer par GuiCtrlCreateList pour pouvoir ensuite sélectionner chaque ligne avec un clic droit ensuite...[11/12/2010 12:50:53] RP350 - listview
[11/12/2010 13:01:24] RP351 - test
[11/12/2010 13:03:08] RP352 - titi
[11/12/2010 13:29:18] RP353 - ERTZ
[11/12/2010 13:34:55] RP354 - auto
Code : Tout sélectionner
#include <GUIConstantsEx.au3> ; pour la gui
#include <WindowsConstants.au3>
#include <EditConstants.au3>
#include <StaticConstants.au3>
Opt("GUIDataSeparatorChar",@CRLF)
$Gui = GUICreate(" Un clic", 700, 360) ;h360 w326
$BouttonLister = GUICtrlCreateButton("Lister", 6, 145, 100, 25)
$ListePoint = GUICtrlCreateList("", 6, 190, 660, 160) ;310
GUICtrlSetLimit(-1, 200) ; to limit horizontal scrolling
GUISetState(@SW_SHOW)
Global $RPList ; On définie une variable vide
Func WMIDateStringToDate($dtmInstallDate)
Return (StringMid($dtmInstallDate, 5, 2) & "/" & _
StringMid($dtmInstallDate, 7, 2) & "/" & StringLeft($dtmInstallDate, 4) _
& " " & StringMid ($dtmInstallDate, 9, 2) & ":" & _
StringMid($dtmInstallDate, 11, 2) & ":" & StringMid($dtmInstallDate, _
13, 2))
EndFunc
Do
GUISetState()
$Msg = GUIGetMsg()
Switch $Msg
Case $BouttonLister
GUICtrlSetData($ListePoint, "Veuillez patienter pendant la création de la liste des 5 derniers points de restauration...")
$i = 0
$dtmConvertedDate = ObjCreate("WbemScripting.SWbemDateTime")
$objWMI = ObjGet("winmgmts:\\localhost\root\default")
$colItems = $objWMI.ExecQuery("SELECT * FROM SystemRestore")
If $colItems.Count = 0 Then
MsgBox(0, "Aucun Point", "No restore point in system.")
Else
$i = $colItems.Count
;For Each $objItem In $colItems
If IsObj($colItems) Then
For $objItem In $colItems
If $i < 6 Then
$dtmConvertedDate.Value = $objItem.CreationTime
$dtmCreationTime = $dtmConvertedDate.GetVarDate
;$RPList &= "[" & WMIDateStringToDate($objItem.CreationTime) & "] " & "RP" & $objItem.SequenceNumber & " - " & $objItem.Description & " " & @CRLF
$RPList &= "[" & WMIDateStringToDate($dtmCreationTime) & "] " & "RP" & $objItem.SequenceNumber & " - " & $objItem.Description & " " & @CRLF
EndIf
$i = $i - 1
Next
EndIf
EndIf
GUICtrlSetData($ListePoint, $RPList)
$RPLIST = "" ; vide la variable
EndSwitch
Until $Msg = $GUI_EVENT_CLOSE
pourquoi ?
Edit :
ah j'ai aussi essayé d'ajouter ceci : BitOR($LBS_MULTIPLESEL) et je ne comprend pas il me renvoie une erreur pourquoi ? Si j'ai compris si pour faire une multiple sélection.
du genre
ERROR: BitOR() [built-in] called with wrong number of args
ou qu'elle n'est pas déclaré
Merci d'avance
Laddyr




