Browse Source

HideExplorerSearchBar: Fixed on OS builds 22621+

pull/1138/head
Valentin Radu 3 years ago
parent
commit
aeeb362045
  1. 17
      ExplorerPatcher/HideExplorerSearchBar.c
  2. 1
      ExplorerPatcher/HideExplorerSearchBar.h

17
ExplorerPatcher/HideExplorerSearchBar.c

@ -103,19 +103,14 @@ LRESULT CALLBACK HideExplorerSearchBarSubClass(
DWORD_PTR dwRefData 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); RemoveWindowSubclass(hWnd, HideExplorerSearchBarSubClass, (UINT_PTR)HideExplorerSearchBarSubClass);
break;
} }
return DefSubclassProc(hWnd, uMsg, wParam, lParam); return DefSubclassProc(hWnd, uMsg, wParam, lParam);
} }

1
ExplorerPatcher/HideExplorerSearchBar.h

@ -3,6 +3,7 @@
#include <Windows.h> #include <Windows.h>
#include <commctrl.h> #include <commctrl.h>
#pragma comment(lib, "Comctl32.lib") #pragma comment(lib, "Comctl32.lib")
#include "osutility.h"
// https://stackoverflow.com/questions/30141592/how-do-i-find-a-handle-inside-a-control // https://stackoverflow.com/questions/30141592/how-do-i-find-a-handle-inside-a-control
HWND FindChildWindow( HWND FindChildWindow(

Loading…
Cancel
Save