Guest User

Untitled

a guest
Feb 25th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.83 KB | None | 0 0
  1. private static class WinImports
  2. {
  3. #region Update Window Size/Positioning
  4. public enum WindowStates : int
  5. {
  6. Hide = 0,
  7. ShowNormal = 1,
  8. ShowMinimized = 2,
  9. ShowMaximized = 3,
  10. ShowNoActivate = 4,
  11. Show = 5,
  12. Minimize = 6,
  13. ShowMinNoActive = 7,
  14. ShowNa = 8,
  15. Restore = 9,
  16. ShowDefault = 10
  17. }
  18.  
  19. [DllImport("user32.dll")]
  20. public static extern bool ShowWindow(System.IntPtr hWnd, WindowStates cmdShow);
  21. #endregion
  22.  
  23. #region Disable Close Button
  24. public const int MF_BYCOMMAND = 0x00000000;
  25. public const int SC_CLOSE = 0xF060;
  26.  
  27. [DllImport("user32.dll")]
  28. public static extern int DeleteMenu(IntPtr hMenu, int nPosition, int wFlags);
  29.  
  30. [DllImport("user32.dll")]
  31. public static extern IntPtr GetSystemMenu(IntPtr hWnd, bool bRevert);
  32.  
  33. [DllImport("kernel32.dll", ExactSpelling = true)]
  34. public static extern IntPtr GetConsoleWindow();
  35. #endregion
  36.  
  37. #region Prevent Quick Edit WinImports
  38. public const uint ENABLE_QUICK_EDIT = 0x0040;
  39.  
  40. // STD_INPUT_HANDLE (DWORD): -10 is the standard input device.
  41. public const int STD_INPUT_HANDLE = -10;
  42.  
  43. [DllImport("kernel32.dll", SetLastError = true)]
  44. public static extern IntPtr GetStdHandle(int nStdHandle);
  45. [DllImport("kernel32.dll")]
  46. public static extern bool GetConsoleMode(IntPtr hConsoleHandle, out uint lpMode);
  47.  
  48. [DllImport("kernel32.dll")]
  49. public static extern bool SetConsoleMode(IntPtr hConsoleHandle, uint dwMode);
  50. #endregion
  51.  
  52. }
Add Comment
Please, Sign In to add comment