orbtk
orbtk copied to clipboard
Window Decorations: Enable/Disable
Context
I am currently trying to create a window with no decorations (and specifically without the title bar as well).
Problem description & Solution
Prior art: issue https://github.com/redox-os/orbtk/issues/337 describes how the .borderless()
method could be used to disable borders of a window (which does not include the title bar on Windows). As a result, the title bar is not removed and does not satisfy my current needs.
A proposed API to implement this is probably a .window_decorations()
method on the Window
structure which takes in an IntoPropertySource<bool>
or something ~~or maybe some bikeshedding on the method name...?~~.
Or, maybe extend the .borderless()
function to take into consideration for removing the title bar as well for Windows.
In traditional WinForm programs, the C++ code can be used to hide the title bar.
SetWindowLong(hWnd, GWL_STYLE, GetWindowLong(hWnd, GWL_STYLE) & ~WS_CAPTION);