The title on this thread is maybe confusing to understand so let me try to explain with more words.
I want to set an item_index in my listview_handle to state "checked". Since there is no command for that in BlueGUI I was curious to know if I could call this directly using User32.dll. However, I barely understand anything and after some time I came up with this dbpro code.
From what I understand, this "(LPARAM)&lvWkItem" is a pointer to an LVITEM structure (type) that bring data with it from my lvWkItem variable of same structure. But how to send that pointer for user32.dll to read I dunno. Obviously this code is not able to compile.
#CONSTANT LVIS_STATEIMAGEMASK 0xF000
#CONSTANT LVM_SETITEMSTATE 0x1000+43
Type LVITEM
stateMask As Integer
state As Integer
EndType
Function setListViewChecked( hLvwList As Integer, ItemIndex As Integer )
Local lvWkItem As LVITEM
lvWkItem.stateMask = LVIS_STATEIMAGEMASK
lvWkItem.state = INDEXTOSTATEIMAGEMASK(2) // 1=unchecked | 2=checked
Load dll "User32.dll", 1
Call dll 1, "SendMessageA", hLvwList, LVM_SETITEMSTATE, ItemIndex, (LPARAM)&lvWkItem
Delete dll 1
EndFunction
Function INDEXTOSTATEIMAGEMASK( i )
n = ((i)<<12)
EndFunction n
Anyway, maybe I am doing it completely wrong
IS that a game, a program, or 3 year old drawing.