mirror of
https://github.com/ckaczor/Common.Native.git
synced 2026-01-13 17:22:40 -05:00
Add function to send system commands to a window
This commit is contained in:
26
Constants.cs
26
Constants.cs
@@ -198,6 +198,32 @@ namespace Common.Native
|
||||
Restore = 9
|
||||
}
|
||||
|
||||
public enum SysCommand
|
||||
{
|
||||
Size = 0xF000,
|
||||
Move = 0xF010,
|
||||
Minimize = 0xF020,
|
||||
Maximize = 0xF030,
|
||||
NextWindow = 0xF040,
|
||||
PreviousWindow = 0xF050,
|
||||
Close = 0xF060,
|
||||
VerticalScroll = 0xF070,
|
||||
HorizontalScroll = 0xF080,
|
||||
MouseMenu = 0xF090,
|
||||
KeyMenu = 0xF100,
|
||||
Arrange = 0xF110,
|
||||
Restore = 0xF120,
|
||||
TaskList = 0xF130,
|
||||
ScreenSave = 0xF140,
|
||||
HotKey = 0xF150,
|
||||
Default = 0xF160,
|
||||
MonitorPower = 0xF170,
|
||||
ContextHelp = 0xF180,
|
||||
Separator = 0xF00F,
|
||||
Icon = Minimize,
|
||||
Zoom = Maximize,
|
||||
}
|
||||
|
||||
[Flags]
|
||||
public enum SendMessageTimeoutFlags : uint
|
||||
{
|
||||
|
||||
@@ -69,6 +69,11 @@ namespace Common.Native
|
||||
User32.SetWindowPlacement(hWnd, ref windowPlacement);
|
||||
}
|
||||
|
||||
public static void SystemCommand(IntPtr hWnd, Constants.SysCommand command)
|
||||
{
|
||||
User32.SendMessage(hWnd, (uint) Constants.WindowMessage.SysCommand, (IntPtr) command, IntPtr.Zero);
|
||||
}
|
||||
|
||||
public static Icon GetSmallIcon(IntPtr hWnd)
|
||||
{
|
||||
try
|
||||
|
||||
Reference in New Issue
Block a user