Jump to content
Sign in to follow this  
Ahbadiane

_GUICtrlListView_SetItem() with V3.2.12.0 RC4

Recommended Posts

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

post-30403-1210772496_thumb.jpg

Share this post


Link to post
Share on other sites

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.

 

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...