Modify

Opened 18 years ago

Closed 17 years ago

#555 closed Bug (Works For Me)

bug in _GUICtrlListView UDF

Reported by: anonymous Owned by: Gary
Milestone: Component: Standard UDFs
Version: 3.2.12.0 Severity: None
Keywords: Cc:

Description

_GUICtrlListView_SetItemDropHilited didnt work properly, so we tried to find out why.

_GUICtrlListView_SetItemState is buggy. in UDF Doc it says:

; $iState - Item state to be changed
; $iStateMask - Bits that determine whether state is active or inactive

those Values are used for creating a dll struct. the problem now is:

StateMask is the Item state to be changed,
State are the Bits determining the state is activ or not (

this version should work, but I just tested _GUICtrlListView_SetItemDropHilited , which seems to work fine now

; #FUNCTION# ====================================================================================================================
; Name...........: _GUICtrlListView_SetItemState
; Description ...: Changes the state of an item in the control
; Syntax.........: _GUICtrlListView_SetItemState($hWnd, $iIndex, $iState, $iStateMask)
; Parameters ....: $hWnd        - Handle to the control
;                  $iIndex      - Zero based index of the item
;                  $iStateMask  - Item state to be changed
;                  $iState		- Bits that determine whether state is active or inactive
; Return values .: Success      - True
;                  Failure      - False
; Author ........: Paul Campbell (PaulIA)
; Modified.......:
; Remarks .......:
; Related .......: _GUICtrlListView_GetItemState
; Link ..........;
; Example .......; Yes
; ===============================================================================================================================
Func _GUICtrlListView_SetItemState($hWnd, $iIndex, $iStateMask, $iState)
	Local $tItem

	$tItem = DllStructCreate($tagLVITEM)
	DllStructSetData($tItem, "Mask", $LVIF_STATE)
	DllStructSetData($tItem, "Item", $iIndex)
	DllStructSetData($tItem, "StateMask", $iStateMask)
	DllStructSetData($tItem, "State", $iState)
	
	Return _GUICtrlListView_SetItemEx($hWnd, $tItem) <> 0
EndFunc   ;==>_GUICtrlListView_SetItemState

Attachments (0)

Change History (3)

comment:1 by anonymous, 18 years ago

I think, some other Functions have to be changed then, too :)
_GUICtrlListView_SetItemDropHilited is correct, but it didn't work with the old _GUICtrlListView_SetItemState, with the corrected one, the DropHilite can be deleted again.

comment:2 by Gary, 17 years ago

Show some code where the old doesn't work. Not seeing any problem with the current code in the include.

comment:3 by Gary, 17 years ago

Resolution: Works For Me
Status: newclosed

Closing as works for me.

Modify Ticket

Action
as closed The owner will remain Gary.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.