Hi guys,
I'm trying to trap the Delete key in a TreeView control (so that I can use that to delete an item from the tree).
In the function's parameters, I see that we have this:
"ByVal lpTVKB As TV_KEYDOWN Ptr _ ' pointer to TV_KEYDOWN"
How do I go about using lpTVKB in my program?
Edit:
I'm able to trap the key that I want using this:
If (GetKeyState(%VK_DELETE) And &H8000) Then
lResult& = MsgBox("Hi there")
End If
But how would I go about using the pointer?
Thanks!
John
Something like this......
'--------------------------------------------------------------------------------
Function FRMMAIN_TREEVIEW1_TVN_KEYDOWN ( _
ControlIndex As Long, _ ' index in Control Array
hWndForm As Dword, _ ' handle of Form
hWndControl As Dword, _ ' handle of Control
ByVal lpTVKB As TV_KEYDOWN Ptr _ ' pointer to TV_KEYDOWN
) As Long
Select Case @lpTVKB.wvKey
Case %VK_DELETE
? "delete pressed"
Case %VK_DOWN
? "down pressed"
Case %VK_UP
? "up pressed"
'case
' etc....
End Select
End Function
Great!, thank you Paul.
John