How can I create borderless window with Direct2D?
In WPF I cen easely remove window border with click in XAML Designer (Blend) and check NoStyle. I want achieve same look with Win32 and Direct2D, but I am without success and ducomentation under microsoft site is only basic without any deep dive in to Win32.
I am following this tutorials https://learn.microsoft.com/en-us/windows/win32/learnwin32/your-first-direct2d-program
MainWindow mw;
if (!mw.Create(L"Circle"
, WS_OVERLAPPEDWINDOW
/*, WS_POPUP // when using this, windows is not displaying*/
))
{
return 0;
}
Instead WS_OVERLAPPEDWINDOW
I tried use WS_POPUP
, but then windows is not displayed, except I can see it on taskbar and close it but the "display area" or client area is blank.
How to make borderless window with Direct2D?
--
I discovered where is the problem with WS_POPUP
style. When I set specific window size (before CW_USEDEFAULT
was used) popup window is displayed.
Now I have additional question:
- doeas this
WS_POPUP
is ok to use it as borderless window for whole application, or there are better solutions?
- Can I compose windows style from "nothing"and add aditional controls, like border and with only close button? Where are documentation about "composing style"? Under MS documentation, I can't find those informations.
--
When I use this (inspired form searching over internet and @Sam of Simple Samples post)
~(WS_CAPTION | WS_THICKFRAME | WS_VSCROLL | WS_HSCROLL | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_DISABLED)
for Create(...)
function I got same "look" as WS_POPUP
. But it is not mentioned nowhere that I can use ~
which "disable" style and turn on another (as you can see I have to add WS_DISABLED
because without it windows is disabled.