extern void ResizeWnd(int cx, int cy)
{
- HDWP hdwp = BeginDeferWindowPos(3);
+ HDWP hdwp = BeginDeferWindowPos(4);
RECT rt, rs, rb;
const int tHeight = 22;
SetRect(&rt, 0, 0, cx, cy);
}
GetWindowRect(g_pChildWnd->hAddressBtnWnd, &rb);
cx = g_pChildWnd->nSplitPos + SPLIT_WIDTH/2;
- DeferWindowPos(hdwp, g_pChildWnd->hAddressBarWnd, 0, rt.left, rt.top, rt.right-rt.left - 2*tHeight, tHeight, SWP_NOZORDER|SWP_NOACTIVATE);
- DeferWindowPos(hdwp, g_pChildWnd->hAddressBtnWnd, 0, rt.right - 2*tHeight, rt.top, 2*tHeight, tHeight, SWP_NOZORDER|SWP_NOACTIVATE);
- DeferWindowPos(hdwp, g_pChildWnd->hTreeWnd, 0, rt.left, rt.top + tHeight+2, g_pChildWnd->nSplitPos-SPLIT_WIDTH/2-rt.left, rt.bottom-rt.top-cy, SWP_NOZORDER|SWP_NOACTIVATE);
- DeferWindowPos(hdwp, g_pChildWnd->hListWnd, 0, rt.left+cx, rt.top + tHeight+2, rt.right-cx, rt.bottom-rt.top-cy, SWP_NOZORDER|SWP_NOACTIVATE);
- EndDeferWindowPos(hdwp);
+ if (hdwp) hdwp = DeferWindowPos(hdwp, g_pChildWnd->hAddressBarWnd, 0, rt.left, rt.top, rt.right-rt.left - 2*tHeight, tHeight, SWP_NOZORDER|SWP_NOACTIVATE);
+ if (hdwp) hdwp = DeferWindowPos(hdwp, g_pChildWnd->hAddressBtnWnd, 0, rt.right - 2*tHeight, rt.top, 2*tHeight, tHeight, SWP_NOZORDER|SWP_NOACTIVATE);
+ if (hdwp) hdwp = DeferWindowPos(hdwp, g_pChildWnd->hTreeWnd, 0, rt.left, rt.top + tHeight+2, g_pChildWnd->nSplitPos-SPLIT_WIDTH/2-rt.left, rt.bottom-rt.top-cy, SWP_NOZORDER|SWP_NOACTIVATE);
+ if (hdwp) hdwp = DeferWindowPos(hdwp, g_pChildWnd->hListWnd, 0, rt.left+cx, rt.top + tHeight+2, rt.right-cx, rt.bottom-rt.top-cy, SWP_NOZORDER|SWP_NOACTIVATE);
+ if (hdwp) EndDeferWindowPos(hdwp);
}
/*******************************************************************************
/*******************************************************************************
*
- * FUNCTION: _CmdWndProc(HWND, unsigned, WORD, LONG)
+ * FUNCTION: ChildWnd_CmdWndProc(HWND, unsigned, WORD, LONG)
*
* PURPOSE: Processes WM_COMMAND messages for the main frame window.
*
*/
-static BOOL _CmdWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
+static BOOL ChildWnd_CmdWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
HTREEITEM hSelection;
HKEY hRootKey;
LPCWSTR keyPath, rootName;
LPWSTR fullPath;
+ /* Wipe the listview, the status bar and the address bar if the root key was selected */
+ if (TreeView_GetParent(g_pChildWnd->hTreeWnd, hItem) == NULL)
+ {
+ (void)ListView_DeleteAllItems(g_pChildWnd->hListWnd);
+ SendMessageW(hStatusBar, SB_SETTEXTW, 0, (LPARAM)NULL);
+ SendMessageW(g_pChildWnd->hAddressBarWnd, WM_SETTEXT, 0, (LPARAM)NULL);
+ return;
+ }
+
if (pszPath == NULL)
keyPath = GetItemPath(g_pChildWnd->hTreeWnd, hItem, &hRootKey);
else
PostMessageW(g_pChildWnd->hAddressBarWnd, WM_KEYUP, VK_RETURN, 0);
}
- if (!_CmdWndProc(hWnd, message, wParam, lParam))
+ if (!ChildWnd_CmdWndProc(hWnd, message, wParam, lParam))
{
goto def;
}