Ahbadiane Posted May 14, 2008 Posted May 14, 2008 Hello, I have a curiosity with the quite new version 3.2.12.0 RC4 with the function _GUICtrlListView_SetItem(). Simply with the example given in the help, I obtain strange posted characters having made the command _GUICtrlListView_SetItem(hListView, " New Item 2 ", 1). (Vista and XP) Is it a bug or a bad installation ? Ahbadiane
GaryFrost Posted May 14, 2008 Posted May 14, 2008 Replace the function in GuiListView.au3 with the following: Func _GUICtrlListView_SetItem($hWnd, $sText, $iIndex = 0, $iSubItem = 0, $iImage = -1, $iParam = -1, $iIndent = -1) Local $iBuffer, $pBuffer, $tBuffer, $tItem, $iMask $iBuffer = StringLen($sText) + 1 If @AutoItUnicode Then $tBuffer = DllStructCreate("wchar Text[" & $iBuffer & "]") Else $tBuffer = DllStructCreate("char Text[" & $iBuffer & "]") EndIf $pBuffer = DllStructGetPtr($tBuffer) $tItem = DllStructCreate($tagLVITEM) $iMask = $LVIF_TEXT If $iImage <> -1 Then $iMask = BitOR($iMask, $LVIF_IMAGE) If $iParam <> -1 Then $iMask = BitOR($iMask, $LVIF_PARAM) If $iIndent <> -1 Then $iMask = BitOR($iMask, $LVIF_INDENT) DllStructSetData($tBuffer, "Text", $sText) DllStructSetData($tItem, "Mask", $iMask) DllStructSetData($tItem, "Item", $iIndex) DllStructSetData($tItem, "SubItem", $iSubItem) DllStructSetData($tItem, "Text", $pBuffer) DllStructSetData($tItem, "TextMax", $iBuffer) DllStructSetData($tItem, "Image", $iImage) DllStructSetData($tItem, "Param", $iParam) DllStructSetData($tItem, "Indent", $iIndent) Return _GUICtrlListView_SetItemEx($hWnd, $tItem) EndFunc ;==>_GUICtrlListView_SetItem SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference.
Ahbadiane Posted May 15, 2008 Author Posted May 15, 2008 Thx Gary for this fast and effective answer Ahbadiane
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now