[Win32 API] Resizing a borderless window?

  • Thread starter Thread starter shangjiaxuan
  • Start date Start date
S

shangjiaxuan

Guest
I was trying to implement a borderless window that can be scaled by handling WM_NCHITTEST message. This works now, but whenever I put another window in front, this "borderless" window gets a thick white border. The window style includes WS_THICKFRAME, which is required to make window resizable, and when the window is upfront does not impose any issues. Without WS_THICKFRAME, borderless windows will not get that white border when in the background, but I cannot do the resizing either.


This white border is acceptable if the window is actually a rectangle, but it makes sense to (and I was trying to ) use DwmEnableBlurBehind and make parts of the window transparent. It also makes sense to use SetWindowRgn to make the mouse able to pass through the window if transparent to select something behind the window. When combined, the white border loses its straight outline and turn into something like paint stain (thick line cropped by the the region border).


This means custom shaped window cannot do anti-aliasing of border on their own. Is there any API that I'm not aware of to remove that thick line?

Continue reading...
 
Back
Top