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
{
public Form1()
{
InitializeComponent();
}
[DllImport("dwmapi.dll", PreserveSig = false)]
public static extern bool DwmIsCompositionEnabled();
[DllImport("dwmapi.dll", PreserveSig = false)]
public static extern void DwmExtendFrameIntoClientArea(IntPtr hWnd, ref MARGINS pMargins);
[StructLayout(LayoutKind.Sequential)]
public struct MARGINS
{
public int Left;
public int Right;
public int Top;
public int Bottom;
}
private void Form1_Load(object sender, EventArgs e)
{
// Form上にはlabelやtextboxを適当に配置して
this.BackColor = Color.Black;
if (DwmIsCompositionEnabled())
{
MARGINS margin = new MARGINS();
margin.Top = -1;
margin.Right = 0;
margin.Left = 0;
margin.Bottom = 0;
DwmExtendFrameIntoClientArea(this.Handle, ref margin);
}
}
}
}
dXNpbmcgU3lzdGVtOwp1c2luZyBTeXN0ZW0uQ29sbGVjdGlvbnMuR2VuZXJpYzsKdXNpbmcgU3lzdGVtLkNvbXBvbmVudE1vZGVsOwp1c2luZyBTeXN0ZW0uRGF0YTsKdXNpbmcgU3lzdGVtLkRyYXdpbmc7CnVzaW5nIFN5c3RlbS5MaW5xOwp1c2luZyBTeXN0ZW0uVGV4dDsKdXNpbmcgU3lzdGVtLldpbmRvd3MuRm9ybXM7CnVzaW5nIFN5c3RlbS5SdW50aW1lLkludGVyb3BTZXJ2aWNlczsKCm5hbWVzcGFjZSB0ZXN0CnsKICAgIHB1YmxpYyBwYXJ0aWFsIGNsYXNzIEZvcm0xIDogRm9ybQogICAgewogICAgICAgIHB1YmxpYyBGb3JtMSgpCiAgICAgICAgewogICAgICAgICAgICBJbml0aWFsaXplQ29tcG9uZW50KCk7CiAgICAgICAgfQoKICAgICAgICBbRGxsSW1wb3J0KCJkd21hcGkuZGxsIiwgUHJlc2VydmVTaWcgPSBmYWxzZSldCiAgICAgICAgcHVibGljIHN0YXRpYyBleHRlcm4gYm9vbCBEd21Jc0NvbXBvc2l0aW9uRW5hYmxlZCgpOwogICAgICAgIFtEbGxJbXBvcnQoImR3bWFwaS5kbGwiLCBQcmVzZXJ2ZVNpZyA9IGZhbHNlKV0KICAgICAgICBwdWJsaWMgc3RhdGljIGV4dGVybiB2b2lkIER3bUV4dGVuZEZyYW1lSW50b0NsaWVudEFyZWEoSW50UHRyIGhXbmQsIHJlZiBNQVJHSU5TIHBNYXJnaW5zKTsKICAgICAgICBbU3RydWN0TGF5b3V0KExheW91dEtpbmQuU2VxdWVudGlhbCldCiAgICAgICAgcHVibGljIHN0cnVjdCBNQVJHSU5TCiAgICAgICAgewogICAgICAgICAgICBwdWJsaWMgaW50IExlZnQ7CiAgICAgICAgICAgIHB1YmxpYyBpbnQgUmlnaHQ7CiAgICAgICAgICAgIHB1YmxpYyBpbnQgVG9wOwogICAgICAgICAgICBwdWJsaWMgaW50IEJvdHRvbTsKICAgICAgICB9ICAgICAgICAKICAgICAgICAKICAgICAgICBwcml2YXRlIHZvaWQgRm9ybTFfTG9hZChvYmplY3Qgc2VuZGVyLCBFdmVudEFyZ3MgZSkKICAgICAgICB7CiAgICAgICAgICAgIC8vIEZvcm3kuIrjgavjga9sYWJlbOOChHRleHRib3jjgpLpganlvZPjgavphY3nva7jgZfjgaYKICAgICAgICAgICAgdGhpcy5CYWNrQ29sb3IgPSBDb2xvci5CbGFjazsKICAgICAgICAgICAgaWYgKER3bUlzQ29tcG9zaXRpb25FbmFibGVkKCkpCiAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgIE1BUkdJTlMgbWFyZ2luID0gbmV3IE1BUkdJTlMoKTsKICAgICAgICAgICAgICAgIG1hcmdpbi5Ub3AgPSAtMTsKICAgICAgICAgICAgICAgIG1hcmdpbi5SaWdodCA9IDA7CiAgICAgICAgICAgICAgICBtYXJnaW4uTGVmdCA9IDA7CiAgICAgICAgICAgICAgICBtYXJnaW4uQm90dG9tID0gMDsKICAgICAgICAgICAgICAgIER3bUV4dGVuZEZyYW1lSW50b0NsaWVudEFyZWEodGhpcy5IYW5kbGUsIHJlZiBtYXJnaW4pOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgfQp9Cg==