Skip to content

Add Hide File Explorer Focus Border#3972

Open
YuUNaO7122 wants to merge 2 commits into
ramensoftware:mainfrom
YuUNaO7122:main
Open

Add Hide File Explorer Focus Border#3972
YuUNaO7122 wants to merge 2 commits into
ramensoftware:mainfrom
YuUNaO7122:main

Conversation

@YuUNaO7122
Copy link
Copy Markdown

Adds a new Windhawk mod: Hide File Explorer Focus Border.

This mod hides the white focus border around focused items in File Explorer by suppressing a specific DrawThemeBackgroundEx call.

Tested environment:

  • Windows 11 25H2, OS Build 26200.8328
  • Windhawk 1.7.3
  • Theme: dark mode

Notes:

  • This mod targets the modern File Explorer item focus border.
  • It does not target the classic dotted focus rectangle on the desktop.
  • The behavior may vary depending on Windows version, display scaling, and File Explorer view mode.
  • If the focus border is still visible, adjust MinWidth/MaxWidth/MinHeight/MaxHeight in the mod settings.

Changelog

Initial release.

Mod authorship

If the submission is a new mod, please fill the form below.

This mod was created by:

    • Manually by the submitter (with or without AI assistance)
    • Claude
    • ChatGPT
    • Gemini
    • Another AI (please specify):
    • Other (please specify):

Please select the appropriate option. Your selection will not affect acceptance criteria, but will help reviewers understand the context of the code and provide relevant feedback.

// File Explorer item focus border.
if (partId == 3 && stateId == 1 && RectMatches(rc)) {
return S_OK;
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To reduce the change of unwanted matches here, have you considered checking the theme class as well? Here's an example:

static bool IsTreeViewTheme(HTHEME hTheme)
{
typedef HRESULT (WINAPI* GetThemeClass_t)(HTHEME, LPWSTR, int);
static auto pGetThemeClass =
(GetThemeClass_t)GetProcAddress(GetModuleHandleW(L"uxtheme.dll"), MAKEINTRESOURCEA(74));
if (!pGetThemeClass || !hTheme)
return false;
wchar_t buf[256] = {};
if (FAILED(pGetThemeClass(hTheme, buf, ARRAYSIZE(buf))))
return false;
return wcsstr(buf, L"TreeView") != nullptr;
}

With a better match, perhaps it will be possible to also get rid of the size limits which are basically a workaround.

/*
# Hide File Explorer Focus Border

Hides the white focus border around focused items in File Explorer.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about adding a screenshot to show what exactly it hides?


Notes:
- This mod targets the modern File Explorer item focus border.
- It does not target the classic dotted focus rectangle on the desktop.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can link this mod here:
https://windhawk.net/mods/no-focus-rectangle

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.

2 participants