Well I have been working on a little project here and it makes use of the Tree View Control. Now since there isn't any built in support for it you have to subclass and receive messages.
Firstly I was using WM_PARENTNOTIFY and the returned value of wParam was WM_LBUTTONDOWN. Now what I need is to be able to use a double click not just a single click. So I did some research and came across website:
http://www.codeproject.com/treectrl/treeview.asp.
Now a specific section talks about catching
WM_NOTIFY and using the
NMHDR structure to get which command :
quote:
NM_CLICK ; user has clicked the left mouse button within the control
NM_DBLCLK ; user has Double clicked the left mouse button within the control
NM_RCLICK ; user has clicked the right mouse button within the control
NM_RDBLCLK ; user has Double clicked the left mouse button within the control
Now this is all fine and dandy however I can understand that I can use SendMessageW with WM_NOTIFY and the defined structure will be filled with the information I need however... This message is supposed to be returned in the OnWindowIdEvent_MessageNotification function. So my dilemma is the website example says that lParam is the
NMHDR structure however there would be no way to access the members of the structure.
Any ideas?
As well here is the current function in my script.
code:
function On_editorEvent_MessageNotification(pPlusWnd, /* Window Object */
nMessage, /* Window Message Received */
wParam, /* wParam field message */
lParam) /* lParam field message */
{
switch (nMessage){
case WM_PARENTNOTIFY:
_sent_notify = true;
Interop.Call('user32', 'SendMessageW', _window.Handle,
WM_NOTIFY,
pPlusWnd.GetControlHandle('tvFiles'),
NMHDR.DataPtr);
break;
case WM_NOTIFY:
_get_item(pPlusWnd);
if (_sent_notify == true){
Interop.Call('kernel32', 'RtlMoveMemory', NMHDR, lParam, 12);
Debug.Trace(NMHDR.ReadDWORD(0));
_sent_notify = false;
}
break;
}
}