9. Windows Formsでつくってみる
(1)
• まず、P/Invoke (プラットフォーム呼び出し)
2014/12/21 9
public struct MARGINS
{
public int Left;
public int Right;
public int Top;
public int Bottom;
}
[DllImport("dwmapi.dll", PreserveSig = false)]
public static extern void DwmExtendFrameIntoClientArea(IntPtr hwnd, ref MARGINS margins);
10. Windows Formsでつくってみる
(2)
• WindowのクラスのOnLoadで実行
2014/12/21 10
protected override void OnLoad(EventArgs e) {
base.OnLoad(e);
try {
var margins = new MARGINS()
{
Top = 0,
Left = -1,
Right = 0,
Bottom = 0,
};
DwmExtendFrameIntoClientArea(this.Handle, ref margins);
BackColor = Color.Black;
}
catch (Exception exception) {
Console.WriteLine(exception.StackTrace);
}
}