Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private static class WinImports
- {
- #region Update Window Size/Positioning
- public enum WindowStates : int
- {
- Hide = 0,
- ShowNormal = 1,
- ShowMinimized = 2,
- ShowMaximized = 3,
- ShowNoActivate = 4,
- Show = 5,
- Minimize = 6,
- ShowMinNoActive = 7,
- ShowNa = 8,
- Restore = 9,
- ShowDefault = 10
- }
- [DllImport("user32.dll")]
- public static extern bool ShowWindow(System.IntPtr hWnd, WindowStates cmdShow);
- #endregion
- #region Disable Close Button
- public const int MF_BYCOMMAND = 0x00000000;
- public const int SC_CLOSE = 0xF060;
- [DllImport("user32.dll")]
- public static extern int DeleteMenu(IntPtr hMenu, int nPosition, int wFlags);
- [DllImport("user32.dll")]
- public static extern IntPtr GetSystemMenu(IntPtr hWnd, bool bRevert);
- [DllImport("kernel32.dll", ExactSpelling = true)]
- public static extern IntPtr GetConsoleWindow();
- #endregion
- #region Prevent Quick Edit WinImports
- public const uint ENABLE_QUICK_EDIT = 0x0040;
- // STD_INPUT_HANDLE (DWORD): -10 is the standard input device.
- public const int STD_INPUT_HANDLE = -10;
- [DllImport("kernel32.dll", SetLastError = true)]
- public static extern IntPtr GetStdHandle(int nStdHandle);
- [DllImport("kernel32.dll")]
- public static extern bool GetConsoleMode(IntPtr hConsoleHandle, out uint lpMode);
- [DllImport("kernel32.dll")]
- public static extern bool SetConsoleMode(IntPtr hConsoleHandle, uint dwMode);
- #endregion
- }
Add Comment
Please, Sign In to add comment