Hey there,
I'm writing an application that when my Dialog's Edit Box Recieves "EN_KILLFOCUS".
It sets a corresponding TreeView Item's Text to the Edit Box's Text.
I've debugged the code block and my HTREEITEM initialises fine but, when I try to get the handle to the TreeView item edit box when TVM_EDITLABEL is sent. It returns NULL.
case WM_COMMAND:
switch (LOWORD(wParam)) // Control IDC_* or Menu IDM_*
{
case IDC_REG_NAMEEDIT: // Name Edit Box
//=========================================================
switch (HIWORD(wParam))
{
case EN_KILLFOCUS:
{
HTREEITEM hArchive;
HWND htvEdit;
// Get Edit Control Text
char buffer[MAX_PATH];
GetWindowText(hNameEdit, buffer, MAX_PATH);
// Get "Archive" ROOT_ITEM handle
hArchive = TreeView_GetRoot(hTree);
// Get the tv Edit Box
htvEdit = TreeView_EditLabel(hTree, hArchive);
// Set the text
SetWindowText(htvEdit, buffer);
// Stop Editing
TreeView_EndEditLabelNow(hTree, false);
// Nullify Pointers
//---------------------------------------------------------
hArchive = NULL;
htvEdit = NULL;
}
break;
}
break;