Hi, i’m trying to handle the Tree-view’s NM_DBLCLK message, to display the name of the D Clicked item:
Code:
LRESULT CALLBACK DlgProc(HWND hWndDlg, UINT Msg, WPARAM wParam, LPARAM lParam)
{
TVITEM tv;
HWND hwndTree;
char msg[MAX_PATH];
int err;
switch(Msg)
{
...
case WM_NOTIFY:
switch(((LPNMHDR) lParam)->code)
{
case NM_DBLCLK:
hwndTree = GetDlgItem(hWndDlg, IDTREE);
err =TreeView_GetItem(hwndTree,&tv);
strcpy(msg, "You DCliked on ");
strcat(msg, tv.pszText);
MessageBox(NULL,msg, "MSG",MB_OK);
}
break;
...
}
But tv.pszText returns nothing and err gets zeroed. Please help to fix it.
Thanx.