A borderless window, if I am not mistaken, is marked so that it does not offer a system menu and does not appear on the taskbar.
The fact that any given window has no border and is not displayed on the taskbar is the result of setting style flags in this window. These specific style flags can be set using the SetWindowLong API GetWindowLong and SetWindowLong . However, you have to be careful, as some styles just don't work together.
Over the years, I have written several user controls, and I constantly persuade windows to become what they were not originally.
For example, I wrote my own drop-down control in which I need a window that will behave as a pop-up window and not activate it.
The following code will do this. Notice that the code appears in the OnHandleCreated event of the OnHandleCreated . This is due to the fact that the flags must be changed immediately after installing the descriptor, which indicates that Windows has already installed what, in its opinion, the flags should be.
using System.Runtime.InteropServices; protected override void OnHandleCreated(EventArgs e) { uint dwWindowProperty; User32.SetParent(this.Handle, IntPtr.Zero); dwWindowProperty = User32.GetWindowLong( this.Handle, User32.GWL.EXSTYLE ); dwWindowProperty = dwWindowProperty | (uint)User32.WSEX.TOOLWINDOW | (uint)User32.WSEX.NOACTIVATE; User32.SetWindowLong( this.Handle, User32.GWL.EXSTYLE, dwWindowProperty ); dwWindowProperty = User32.GetWindowLong( this.Handle, User32.GWL.STYLE ); dwWindowProperty = ( dwWindowProperty & ~(uint)User32.WS.CHILD ) | (uint)User32.WS.POPUP; User32.SetWindowLong( this.Handle, User32.GWL.STYLE, dwWindowProperty ); base.OnHandleCreated (e); }
Unfortunately, the SysMenu style cannot be set without using the Caption style, so I canโt say if this is a problem in your implementation.
You can check the source list of styles and the list of advanced styles using these two links:
Window styles
CreateWindowEx
source share