Skip to content

Commit

Permalink
HideExplorerSearchBar: Fixed on OS builds 22621+
Browse files Browse the repository at this point in the history
  • Loading branch information
valinet committed Aug 6, 2022
1 parent a90439d commit aeeb362
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
17 changes: 6 additions & 11 deletions ExplorerPatcher/HideExplorerSearchBar.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,19 +103,14 @@ LRESULT CALLBACK HideExplorerSearchBarSubClass(
DWORD_PTR dwRefData
)
{
switch (uMsg)
if (uMsg == WM_SIZE || uMsg == WM_PARENTNOTIFY)
{
if (uMsg == WM_SIZE && IsWindows11Version22H2OrHigher()) HideExplorerSearchBar(hWnd);
else if (uMsg == WM_PARENTNOTIFY && (WORD)wParam == 1) HideExplorerSearchBar(hWnd);
}
else if (uMsg == WM_DESTROY)
{
case WM_PARENTNOTIFY:
if ((WORD)wParam == 1)
{
HideExplorerSearchBar(hWnd);
}
break;

case WM_DESTROY:
RemoveWindowSubclass(hWnd, HideExplorerSearchBarSubClass, (UINT_PTR)HideExplorerSearchBarSubClass);
break;
}

return DefSubclassProc(hWnd, uMsg, wParam, lParam);
}
1 change: 1 addition & 0 deletions ExplorerPatcher/HideExplorerSearchBar.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include <Windows.h>
#include <commctrl.h>
#pragma comment(lib, "Comctl32.lib")
#include "osutility.h"

// https://stackoverflow.com/questions/30141592/how-do-i-find-a-handle-inside-a-control
HWND FindChildWindow(
Expand Down

0 comments on commit aeeb362

Please sign in to comment.