fast die gleiche Lösung
da es ein editierbares LV ist, hat er wahrscheinlich schon einen Callback fürs LV, der immer da ist.
Code: Alles auswählen
Enumeration
#lig
#butoff
#buton
EndEnumeration
Global bflag
Procedure.i List_CB(hwnd, msg, wParam, lParam)
Protected oldproc = GetWindowLongPtr_(hwnd, #GWL_USERDATA)
Select msg
Case #WM_VSCROLL, #WM_HSCROLL, #WM_MOUSEWHEEL
If bflag
ProcedureReturn 0
EndIf
;case andere Messages wie keydown etc
EndSelect
ProcedureReturn CallWindowProc_(oldproc, hwnd, msg, wParam, lParam)
EndProcedure
OpenWindow(0, 0, 0, 500, 300, "ListIconGadgets", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
id = ListIconGadget(#lig, 10, 25, 400, 100, "Column 1", 100, #PB_ListIcon_FullRowSelect)
oldproc_gadget = SetWindowLongPtr_(id, #GWL_WNDPROC, @List_CB())
SetWindowLongPtr_(id, #GWL_USERDATA, oldproc_gadget)
ButtonGadget(#butoff, 10, 140, 55, 22, "off")
ButtonGadget(#buton , 10, 170, 55, 22, "on")
For b = 2 To 4
AddGadgetColumn(#lig, b, "Column " + Str(b), 65)
Next
For b = 0 To 20
AddGadgetItem(#lig, b, "Item 1"+ Str(b)+Chr(10)+"Item 2"+Chr(10)+"Item 3"+Chr(10)+"Item 4")
Next
Repeat :
event = WaitWindowEvent()
Select event
Case #PB_Event_Gadget
Select EventGadget()
Case #butoff: bflag = 1: Debug "butoff" + bflag
Case #buton: bflag = 0: Debug "buton" + bflag
EndSelect
EndSelect
Until Event = #PB_Event_CloseWindow