mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 15:55:57 +00:00
[REGEDIT] Fix Incorrect status bar (#7944)
This fixes the incorrect status bar that happens when context menu action is used. CORE-19524
This commit is contained in:
parent
2e7cfa0400
commit
986c4778fa
1 changed files with 25 additions and 2 deletions
|
@ -165,9 +165,32 @@ void SetupStatusBar(HWND hWnd, BOOL bResize)
|
|||
void UpdateStatusBar(void)
|
||||
{
|
||||
HKEY hKeyRoot;
|
||||
LPCWSTR pszKeyPath = GetItemPath(g_pChildWnd->hTreeWnd, 0, &hKeyRoot);
|
||||
LPCWSTR pszKeyPath, pszRootName;
|
||||
LPWSTR pszFullPath;
|
||||
DWORD dwCbFullPath;
|
||||
|
||||
SendMessageW(hStatusBar, SB_SETTEXTW, 0, (LPARAM)pszKeyPath);
|
||||
pszKeyPath = GetItemPath(g_pChildWnd->hTreeWnd, 0, &hKeyRoot);
|
||||
if (!pszKeyPath)
|
||||
return;
|
||||
|
||||
pszRootName = get_root_key_name(hKeyRoot);
|
||||
dwCbFullPath = (wcslen(pszRootName) + 1 + wcslen(pszKeyPath) + 1) * sizeof(WCHAR);
|
||||
pszFullPath = malloc(dwCbFullPath);
|
||||
if (!pszFullPath)
|
||||
return;
|
||||
|
||||
if (pszKeyPath[0] != UNICODE_NULL)
|
||||
{
|
||||
StringCbPrintfW(pszFullPath, dwCbFullPath, L"%s%s%s", pszRootName,
|
||||
((pszKeyPath[0] == L'\\') ? L"" : L"\\"), pszKeyPath);
|
||||
}
|
||||
else
|
||||
{
|
||||
StringCbCopyW(pszFullPath, dwCbFullPath, pszRootName);
|
||||
}
|
||||
|
||||
SendMessageW(hStatusBar, SB_SETTEXTW, 0, (LPARAM)pszFullPath);
|
||||
free(pszFullPath);
|
||||
}
|
||||
|
||||
static void toggle_child(HWND hWnd, UINT cmd, HWND hchild)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue