using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;
namespace test
{
public partial class Form1 : Form
{
[DllImport("dwmapi.dll")]
private static extern int DwmIsCompositionEnabled(out bool enabled);
[DllImport("dwmapi.dll", PreserveSig = true)]
static extern int DwmExtendFrameIntoClientArea(IntPtr hwnd, ref MARGINS margins);
[StructLayout(LayoutKind.Sequential)]
public struct MARGINS
{
public int leftWidth;
public int rightWidth;
public int topHeight;
public int bottomHeight;
}
public Form1()
{
InitializeComponent();
BackColor = Color.Black;
bool DwmEnabled = false;
DwmIsCompositionEnabled(out DwmEnabled);
if (DwmEnabled == true)
{
MARGINS margin;
margin.leftWidth = -1;
margin.rightWidth = 0;
margin.topHeight = 0;
margin.bottomHeight = 0;
DwmExtendFrameIntoClientArea(this.Handle, ref margin);
}
}
}
}
dXNpbmcgU3lzdGVtOwp1c2luZyBTeXN0ZW0uQ29sbGVjdGlvbnMuR2VuZXJpYzsKdXNpbmcgU3lzdGVtLkNvbXBvbmVudE1vZGVsOwp1c2luZyBTeXN0ZW0uRGF0YTsKdXNpbmcgU3lzdGVtLkRyYXdpbmc7CnVzaW5nIFN5c3RlbS5MaW5xOwp1c2luZyBTeXN0ZW0uVGV4dDsKdXNpbmcgU3lzdGVtLldpbmRvd3MuRm9ybXM7CnVzaW5nIFN5c3RlbS5SdW50aW1lLkludGVyb3BTZXJ2aWNlczsKCm5hbWVzcGFjZSB0ZXN0CnsKICAgIHB1YmxpYyBwYXJ0aWFsIGNsYXNzIEZvcm0xIDogRm9ybQogICAgewoKICAgICAgICBbRGxsSW1wb3J0KCJkd21hcGkuZGxsIildCiAgICAgICAgcHJpdmF0ZSBzdGF0aWMgZXh0ZXJuIGludCBEd21Jc0NvbXBvc2l0aW9uRW5hYmxlZChvdXQgYm9vbCBlbmFibGVkKTsKCiAgICAgICAgW0RsbEltcG9ydCgiZHdtYXBpLmRsbCIsIFByZXNlcnZlU2lnID0gdHJ1ZSldCiAgICAgICAgc3RhdGljIGV4dGVybiBpbnQgRHdtRXh0ZW5kRnJhbWVJbnRvQ2xpZW50QXJlYShJbnRQdHIgaHduZCwgcmVmIE1BUkdJTlMgbWFyZ2lucyk7CgogICAgICAgIFtTdHJ1Y3RMYXlvdXQoTGF5b3V0S2luZC5TZXF1ZW50aWFsKV0KICAgICAgICBwdWJsaWMgc3RydWN0IE1BUkdJTlMKICAgICAgICB7CiAgICAgICAgICAgIHB1YmxpYyBpbnQgbGVmdFdpZHRoOwogICAgICAgICAgICBwdWJsaWMgaW50IHJpZ2h0V2lkdGg7CiAgICAgICAgICAgIHB1YmxpYyBpbnQgdG9wSGVpZ2h0OwogICAgICAgICAgICBwdWJsaWMgaW50IGJvdHRvbUhlaWdodDsKICAgICAgICB9CgogICAgICAgIHB1YmxpYyBGb3JtMSgpCiAgICAgICAgewogICAgICAgICAgICBJbml0aWFsaXplQ29tcG9uZW50KCk7CgogICAgICAgICAgICBCYWNrQ29sb3IgPSBDb2xvci5CbGFjazsKCiAgICAgICAgICAgIGJvb2wgRHdtRW5hYmxlZCA9IGZhbHNlOwogICAgICAgICAgICBEd21Jc0NvbXBvc2l0aW9uRW5hYmxlZChvdXQgRHdtRW5hYmxlZCk7CiAgICAgICAgICAgIGlmIChEd21FbmFibGVkID09IHRydWUpCiAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgIE1BUkdJTlMgbWFyZ2luOwogICAgICAgICAgICAgICAgbWFyZ2luLmxlZnRXaWR0aCA9IC0xOwogICAgICAgICAgICAgICAgbWFyZ2luLnJpZ2h0V2lkdGggPSAwOwogICAgICAgICAgICAgICAgbWFyZ2luLnRvcEhlaWdodCA9IDA7CiAgICAgICAgICAgICAgICBtYXJnaW4uYm90dG9tSGVpZ2h0ID0gMDsKCiAgICAgICAgICAgICAgICBEd21FeHRlbmRGcmFtZUludG9DbGllbnRBcmVhKHRoaXMuSGFuZGxlLCByZWYgbWFyZ2luKTsKICAgICAgICAgICAgfQogICAgICAgIH0KICAgIH0KfQo=