'prepare callbacks
hMsgProc = hwnd(#view.GetMsgHookCallback)
calldll #MsgHook, "TrapMsgFor",hLV as ulong, r as boolean
calldll #MsgHook, "TrapMsgFor",hSlide as ulong, r as boolean
calldll #MsgHook, "WatchMsg", hLV as ulong, _WM_LBUTTONDBLCLK as long, r as boolean
calldll #MsgHook, "WatchMsg", hLV as ulong, _WM_LBUTTONUP as long, r as boolean
calldll #MsgHook, "WatchMsg", hLV as ulong, _WM_RBUTTONUP as long, r as boolean
calldll #MsgHook, "WatchMsg", hLV as ulong, LVM.COLUMNCLICK as long, r as boolean
calldll #MsgHook, "WatchMsg", hSlide as ulong, _WM_LBUTTONUP as long, r as boolean
calldll #MsgHook, "WatchMsg", hParent as ulong, _WM_NOTIFY as long, r as boolean
calldll #user32, "GetWindowLongA",hMsgProc as ulong,_GWL_ID as short,callbackID as long
calldll #MsgHook, "CreateGetMsgProcHook", hParent as ulong, callbackID as long, hMsgProc as ulong, hHook as ulong
[view.callback]
calldll #MsgHook, "GetMsg", msg as struct, ret as void
mesg=msg.message.struct
select case mesg
case _WM_LBUTTONDBLCLK
if fname$<>"" then Notice "test" : goto [content.edit]
case _WM_LBUTTONUP
if msg.hndl.struct=hSlide then goto [navigate.scroll]
rec=LVGETSINGSEL(hLV)
r=DBVIEWNEXTLOAD(hLV,hSlide,rec,record,first,last,"edit")
case _WM_RBUTTONUP
if fname$<>"" then
rec=LVGETSINGSEL(hLV) : record=first+rec-1
goto [content.edit]
end if
case _WM_NOTIFY
if msg.hndl.struct=hParent then print "x"
case LVM.COLUMNCLICK
test=test
end select
goto [view.scanloop]
LVN.COLUMNCLICK = -108
struct nmhdr, hwndFrom as ulong, idFrom as long, code as long
calldll #MsgHook, "WatchMsg", hLV as ulong, _WM_NOTIFY as long, r as boolean