I would like to find a way to put content such as controls into the non-client area of a WPF window without touching the default window control buttons and any other properties of the window.
Attempted Solutions:
I have tried using a WindowChrome object to achieve the wanted result, but it always left a 5px margin to the left and right of the title bar, so the window buttons would get offset inwards, which made it look ugly, janky and unofficial.
I have tried to override WndProc (I mean hook into) to counteract this unwanted effect - with success - but it lead to many unwanted artifacts, such as, in certain cases, the titlebar would completely de-render; the buttons would still work, but they would be completely invisible until the window was dragged.
I have tried methods that use only native windows APIs for window management and rendering, but they don't produce the wanted outcome, with too-thick margins, inconsistent resize borders, and other problems.
Conclusion:
I know there must be a relatively simple and non-clunky way to do this because file explorer itself has what I am trying to implement. If you look in the top left corner, there is a toolstrip followed by the name of the directory you are in, or simply "File Explorer".
How to I achieve something like this? I thank you all in advance for your help.