fork download
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. using System.Runtime.InteropServices;
  10.  
  11. namespace test
  12. {
  13. public partial class Form1 : Form
  14. {
  15. public Form1()
  16. {
  17. InitializeComponent();
  18. }
  19.  
  20. [DllImport("dwmapi.dll", PreserveSig = false)]
  21. public static extern bool DwmIsCompositionEnabled();
  22. [DllImport("dwmapi.dll", PreserveSig = false)]
  23. public static extern void DwmExtendFrameIntoClientArea(IntPtr hWnd, ref MARGINS pMargins);
  24. [StructLayout(LayoutKind.Sequential)]
  25. public struct MARGINS
  26. {
  27. public int Left;
  28. public int Right;
  29. public int Top;
  30. public int Bottom;
  31. }
  32.  
  33. private void Form1_Load(object sender, EventArgs e)
  34. {
  35. // Form上にはlabelやtextboxを適当に配置して
  36. this.BackColor = Color.Black;
  37. if (DwmIsCompositionEnabled())
  38. {
  39. MARGINS margin = new MARGINS();
  40. margin.Top = -1;
  41. margin.Right = 0;
  42. margin.Left = 0;
  43. margin.Bottom = 0;
  44. DwmExtendFrameIntoClientArea(this.Handle, ref margin);
  45. }
  46. }
  47. }
  48. }
  49.  
Not running #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout
Standard output is empty