protected override void OnLoad(EventArgs e) { base.OnLoad(e); _windowList = new List<IntPtr>(); _windowNames = new List<string>(); //SetStyle(ControlStyles.UserPaint, true); //SetStyle(ControlStyles.OptimizedDoubleBuffer, true); SetStyle(ControlStyles.SupportsTransparentBackColor, true); // Set up the glass effect using padding as the defining glass region if (Win32.DwmIsCompositionEnabled()) { _glassMargins = new Margins(); _glassMargins.Top = -1; _glassMargins.Left = -1; _glassMargins.Bottom = -1; _glassMargins.Right = -1; Win32.DwmExtendFrameIntoClientArea(this.Handle, ref _glassMargins); } Win32.EnumWindowsProc enumWindowsDelegate = new Win32.EnumWindowsProc(EnumWindows); Win32.EnumWindows(enumWindowsDelegate, new IntPtr()); windowList.DataSource = _windowNames; }
public static extern void DwmExtendFrameIntoClientArea(IntPtr hwnd, ref Margins margins);