void UpdateStatusBar(void)
{
- NMHDR nmhdr;
- ZeroMemory(&nmhdr, sizeof(NMHDR));
- nmhdr.code = TVN_SELCHANGED;
- SendMessageW(g_pChildWnd->hWnd, WM_NOTIFY, (WPARAM)TREE_WINDOW, (LPARAM)&nmhdr);
+ HKEY hKeyRoot;
+ LPCWSTR pszKeyPath = GetItemPath(g_pChildWnd->hTreeWnd, 0, &hKeyRoot);
+
+ SendMessageW(hStatusBar, SB_SETTEXTW, 0, (LPARAM)pszKeyPath);
}
static void toggle_child(HWND hWnd, UINT cmd, HWND hchild)
keyPath = GetItemPath(g_pChildWnd->hTreeWnd, 0, &hKeyRoot);
valueName = GetValueName(g_pChildWnd->hListWnd, -1);
- if (keyPath)
- {
- lRet = RegOpenKeyExW(hKeyRoot, keyPath, 0, regsam, &hKey);
- if (lRet != ERROR_SUCCESS) hKey = 0;
- }
+
+ if (!keyPath)
+ return TRUE;
+
+ lRet = RegOpenKeyExW(hKeyRoot, keyPath, 0, regsam, &hKey);
+ if (lRet != ERROR_SUCCESS)
+ hKey = 0;
switch (LOWORD(wParam))
{
return DefWindowProcW(hWnd, message, wParam, lParam);
break;
case WM_ACTIVATE:
- if (LOWORD(hWnd))
+ if (LOWORD(hWnd) && g_pChildWnd)
SetFocus(g_pChildWnd->hWnd);
break;
case WM_SIZE: