Skip to content

fix(Taskbar10): type in the Windows 10 taskbar search box on Windows 11 (#4672) - #5219

Open
noel-digital-fan wants to merge 3 commits into
valinet:masterfrom
noel-digital-fan:taskbar10-search-box-visible
Open

noel-digital-fan wants to merge 3 commits into
valinet:masterfrom
noel-digital-fan:taskbar10-search-box-visible

Conversation

@noel-digital-fan

@noel-digital-fan noel-digital-fan commented Oct 30, 2026 •

Copy link
Copy Markdown

Fixes #4672
Fixes #3107

With the Windows 10 (ExplorerPatcher) taskbar on Windows 11 and Search set to "Search box", clicking the search box made it disappear. The Windows 11 search app (SearchHost.exe) then opened as a floating window with its own search box at the top. With this change, search works like on Windows 10: you type in the "Type here to search" box on the taskbar, and the results show up in a panel attached to the taskbar, right above the search box.

I know both issues were closed as "Won't Fix", so please consider reviewing this as a reference for a future update. This was made with the help of Claude Opus 5.5. Thanks for ExplorerPatcher!

Cause

  • SearchHost still has a layout for a search box on the taskbar: no search box at the top of its window, and its text box over the one on the taskbar. It only uses that layout when WindowsUdk.UI.Shell.TaskbarLayout reports TaskbarSearchMode::SearchBox and Search button bounds of at least 200×32. ep_taskbar already reports the bounds, but the ITaskbarSettings that StartMenu.c reports for the Start menu positioning always returned SearchIcon for SearchMode and EffectiveSearchMode.
  • ep_taskbar's TrayDummySearchControl arms a 900 ms timer when the search app is shown and then hides itself. It expects the Windows 10 search app to draw its own search box over it, which SearchHost doesn't do.

Changes

  • StartMenu.c: report SearchBox while ep_taskbar shows the search box (search box mode, no small icons, bottom taskbar). dllmain.c reports again when SearchboxTaskbarMode or TaskbarSmallIcons changes, through the primary taskbar, as for display changes.
  • dllmain.c: don't arm that 900 ms timer (SetTimer hooked in ep_taskbar's IAT), so the search box stays on the taskbar.
  • New Taskbar10SearchBox.cpp: when SearchHost comes to the foreground, EP is loaded into its UI thread with a WH_GETMESSAGE hook.
    • Typing: SearchHost's text box is made invisible but keeps the focus, so typing, keyboard navigation and IMEs work as usual. It stays over the Windows 10 search box, so clicks and IME windows line up. Its text and selection are sent to explorer with WM_COPYDATA, and the placeholder control of the Windows 10 search box is subclassed to draw them with a caret instead of the placeholder text.
    • Start: in the layout SearchHost uses with Start, its search box is collapsed. Start then has no search box, like on Windows 10, and what you type in Start shows up in the search box on the taskbar.
    • Panel: the panel is moved with a render transform so that its bottom edge sits on the taskbar and its left edge lines up with the search box, with square corners and no shadow. SearchHost places its window at the left edge of the screen when it is opened with Start, and a little left of the search box otherwise. So once the window is in the foreground, it is moved to the left edge of the search box. Moving it earlier, while SearchHost is still showing it, makes it lose the keyboard focus.
    • Keeping it attached: the changes are applied again when SearchHost is shown or activated, switches layouts, or lays out its page. SearchHost moves its window from another process with SWP_NOSENDCHANGING, so window moves are handled in WM_WINDOWPOSCHANGED. Right after it shows up, SearchHost also moves the panel without a layout pass. So for one second after showing up, the panel position is also checked before every frame (CompositionTarget::Rendering).

All of this is only active with the Windows 10 (ExplorerPatcher) taskbar on Windows 11. The Windows 11 taskbar is not affected.

Screenshots

Typing after clicking the search box on the taskbar

Testing

Tested on Windows 11 26300.9711 x64 with ep_taskbar.ge.dll, the Windows 10 Start menu, one monitor at 125%, and the dark theme:

  • clicking the search box, then typing, deleting, Ctrl+A, and Esc
  • opening Start with the Windows key or the Start button, then typing
  • opening Start with the Windows key or the Start button, then clicking the search box
  • opening and closing search repeatedly in each of these ways, checking the panel position from inside SearchHost every time

Not tested: the light theme, multiple monitors, ARM64, and other ep_taskbar builds. Top and side taskbars keep the previous behavior, since SearchBox is only reported for bottom taskbars.

Notes

  • The SearchHost side looks up elements of its TaskbarSearchPage by name (SearchBoxControl, TaskbarSearchBackground, SearchTextBox, AppBorder, OuterBorderGrid, QueryFormulationRoot, HCOuterBorderGrid, and the SearchBoxLocationStates visual state group of RootGrid). If a SearchHost update renames them, the changes that depend on them are skipped.
  • The SearchHost code stays loaded in SearchHost after explorer exits, because its XAML event handlers must not outlive the module.

…11 (valinet#4672)

With the Windows 10 (ExplorerPatcher) taskbar, clicking the search box
made it disappear, and the Windows 11 search app showed its own search
box at the top of its window instead.

* Keep the search box visible while Search is open. ep_taskbar hid it
  900 ms after the search app showed, expecting the Windows 10 search
  app to draw its own search box over it.
* Report TaskbarSearchMode::SearchBox instead of SearchIcon along with
  the Start menu positioning while the search box is shown on a bottom
  taskbar, so that the search app (SearchHost.exe) uses its layout for a
  search box on the taskbar instead of the one with a search box at the
  top. Report again when the search box or small icons setting changes.
* Load into the UI thread of the search app when it comes to the
  foreground, make its text box invisible (it keeps the focus), and draw
  its text, selection and a caret in the Windows 10 search box instead
  of the placeholder text. When the search app comes up with Start,
  collapse its search box, so that Start has none, like on Windows 10,
  and what is typed shows up in the search box on the taskbar.
@noel-digital-fan

Copy link
Copy Markdown
Author

Closing for now while I rework a few things (panel attachment to the taskbar, scoping, readability). I'll open a new one when it's ready.

…changes to the Windows 10 taskbar

- Attach the search panel right on top of the taskbar at the left edge of the screen, with square corners and no
  shadow, like on Windows 10, however search is opened (search box, Start button or Windows key)
- Only change the search app and the search mode reported to it when the Windows 10 (ExplorerPatcher) taskbar is used
  on Windows 11; the Windows 11 taskbar is left alone
- Apply the changes again when the search app is activated, resized or typed in, in case it shows up again without
  raising VisibilityChanged
- Refresh the Start menu position when the taskbar search box setting or the taskbar icon size changes
- Rename things and add comments to make the code easier to follow
@pyrates999

Copy link
Copy Markdown

are you using ai for this?

…ed up with its search box

- Line the panel up with the left edge of the search box on the taskbar, right after the Start button, however search
  is opened; the search app's window is moved there once it is in the foreground, whenever the search app moves it
- Attach the panel after resizing the hidden search box, which changes the height of the panel
- Check where the panel is after every layout pass, and before every frame for a moment after search shows up, as the
  search app moves the panel without resizing it, sometimes without even laying it out again
@noel-digital-fan

Copy link
Copy Markdown
Author

Yes, It was made with Claude Opus 5.5.

Please consider reviewing the code, even if you don't intend to merge it because of AI.

It might prove some useful ideas or implementations that you could replicate in your own code.

Thanks for the consideradion

@pyrates999

Copy link
Copy Markdown

You need to understand the code you're submitting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Search box disappears when clicking on it Search bar broken

2 participants