
( See the next example for compatibility with Windows Vista, 7, 8) //requires Dwmapi.lib and UxTheme.lib Use BeginBufferedPaint to draw opaque color over non-client area Use DwmExtendFrameIntoClientArea to get access to non-client area See Custom Window Frame Using DWM for reference. This is rather difficult in Windows Vista and above.

To change it, you must modify the non-client area. In Windows 10 the borders on left/right/bottom are transparent. I also found this related Qt bug report QTBUG-47543 which was closed as not being a Qt problem, because it can be reproduced with win32 api. Return DefWindowProc(hwnd, uMsg, wParam, lParam) LRESULT CALLBACK WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)įillRect(hdc, &ps.rcPaint, (HBRUSH) (COLOR_WINDOWTEXT))

SetWindowPos(hwnd, NULL, 0,0,0,0, SWP_FRAMECHANGED | SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_NOOWNERZORDER) LONG lStyle = GetWindowLong(hwnd, GWL_STYLE) Int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE, PWSTR pCmdLine, int nCmdShow)Ĭonst wchar_t CLASS_NAME = L"Sample Window Class" ĬW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, LRESULT CALLBACK WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) With the following code I create a window and paint all the client area with black, the window gets a left, right and bottom 6px transparent margins, however the top margin is white. This can easily be achieved by removing WS_CAPTION and adding WS_THICKFRAME, however, since Windows 10, there's a 6px white non-client area. You can customize the back color of the icon in title bar using the IconBackColor property.I want a window without title bar but with resizable frames and shadow. Gray 'Sets the back color of the client area. DarkGray 'Sets the pressed state back color of the title bar buttons Me. White 'Sets the hover state back color of the title bar buttons Me. White 'Sets the fore color of the title bar buttons Me. 'Sets the back color and fore color of the title bar. Gray //Sets the back color of the client area. DarkGray //Sets the pressed state back color of the title bar buttons this. White //Sets the hover state back color of the title bar buttons this. White //Sets the fore color of the title bar buttons this. Sets the back color and fore color of the title bar. FromFile ( "pressedMin.ico" ) Hiding the title bar buttonsīuttons in the title bar can be hide by disabling the MinimizeBox, MaximizeBox and CloseButtonVisible properties.

FromFile ( "hoverMin.ico" ) 'Title bar button icons on pressed state Me. FromFile ( "min.ico" ) 'Title bar button icons on hover state Me. 'Title bar button icons on normal state Me.
