I have a window with a solid border around it. How can I remove the border (all of the non-client area) by using SetWindowLong and GetWindowLong?
Click on Colors; Scroll down and disable the option "Show accent color on title bars and windows borders"; So the white border will be removed; I hope I have helped, see you soon!
Go to Design > Page Borders. In the Borders and Shading box, on the Page Border tab, select the arrow next to Apply to and choose the page (or pages) you want to remove the border from. Under Setting, select None, and then select OK.
In C/C++
LONG lStyle = GetWindowLong(hwnd, GWL_STYLE); lStyle &= ~(WS_CAPTION | WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_SYSMENU); SetWindowLong(hwnd, GWL_STYLE, lStyle);
WS_CAPTION is defined as (WS_BORDER | WS_DLGFRAME). You can get away with removing just these two styles, since the minimize maximize and sytem menu will disappear when the caption disappears, but it's best to remove them as well.
It's also best to remove the extended border styles.
LONG lExStyle = GetWindowLong(hwnd, GWL_EXSTYLE); lExStyle &= ~(WS_EX_DLGMODALFRAME | WS_EX_CLIENTEDGE | WS_EX_STATICEDGE); SetWindowLong(hwnd, GWL_EXSTYLE, lExStyle);
And finally, to get your window to redraw with the changed styles, you can use SetWindowPos.
SetWindowPos(hwnd, NULL, 0,0,0,0, SWP_FRAMECHANGED | SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_NOOWNERZORDER);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With