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.  
  16. [DllImport("dwmapi.dll")]
  17. private static extern int DwmIsCompositionEnabled(out bool enabled);
  18.  
  19. [DllImport("dwmapi.dll", PreserveSig = true)]
  20. static extern int DwmExtendFrameIntoClientArea(IntPtr hwnd, ref MARGINS margins);
  21.  
  22. [StructLayout(LayoutKind.Sequential)]
  23. public struct MARGINS
  24. {
  25. public int leftWidth;
  26. public int rightWidth;
  27. public int topHeight;
  28. public int bottomHeight;
  29. }
  30.  
  31. public Form1()
  32. {
  33. InitializeComponent();
  34.  
  35. BackColor = Color.Black;
  36.  
  37. bool DwmEnabled = false;
  38. DwmIsCompositionEnabled(out DwmEnabled);
  39. if (DwmEnabled == true)
  40. {
  41. MARGINS margin;
  42. margin.leftWidth = -1;
  43. margin.rightWidth = 0;
  44. margin.topHeight = 0;
  45. margin.bottomHeight = 0;
  46.  
  47. DwmExtendFrameIntoClientArea(this.Handle, ref margin);
  48. }
  49. }
  50. }
  51. }
  52.  
Not running #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout
Standard output is empty