Moved MouseButtonState from User32 to Shared assembly and up to PInvoke namespace. Fixed dependencies.

pull/211/head
dahall 2020-12-27 17:30:06 -07:00
parent 2066523bd0
commit f0fd3f0334
4 changed files with 34 additions and 30 deletions

View File

@ -0,0 +1,31 @@
using System;
namespace Vanara.PInvoke
{
/// <summary>The state of the other mouse buttons plus the SHIFT and CTRL keys.</summary>
[PInvokeData("winuser.h")]
[Flags]
public enum MouseButtonState
{
/// <summary>The left mouse button is down.</summary>
MK_LBUTTON = 0x0001,
/// <summary>The right mouse button is down.</summary>
MK_RBUTTON = 0x0002,
/// <summary>The SHIFT key is down.</summary>
MK_SHIFT = 0x0004,
/// <summary>The CTRL key is down.</summary>
MK_CONTROL = 0x0008,
/// <summary>The middle mouse button is down.</summary>
MK_MBUTTON = 0x0010,
/// <summary>The XBUTTON1 button is down.</summary>
MK_XBUTTON1 = 0x0020,
/// <summary>The XBUTTON2 button is down.</summary>
MK_XBUTTON2 = 0x0040,
}
}

View File

@ -72,7 +72,7 @@ namespace Vanara.PInvoke
// https://docs.microsoft.com/en-us/windows/desktop/api/shobjidl_core/nf-shobjidl_core-iexecutecommand-setkeystate HRESULT
// SetKeyState( DWORD grfKeyState );
[PreserveSig]
HRESULT SetKeyState(User32.MouseButtonState grfKeyState);
HRESULT SetKeyState(MouseButtonState grfKeyState);
/// <summary>Provides parameter values for the verb.</summary>
/// <param name="pszParameters">

View File

@ -19,33 +19,6 @@ namespace Vanara.PInvoke
GMMP_USE_HIGH_RESOLUTION_POINTS = 2,
}
/// <summary>The state of the other mouse buttons plus the SHIFT and CTRL keys.</summary>
[PInvokeData("winuser.h")]
[Flags]
public enum MouseButtonState
{
/// <summary>The left mouse button is down.</summary>
MK_LBUTTON = 0x0001,
/// <summary>The right mouse button is down.</summary>
MK_RBUTTON = 0x0002,
/// <summary>The SHIFT key is down.</summary>
MK_SHIFT = 0x0004,
/// <summary>The CTRL key is down.</summary>
MK_CONTROL = 0x0008,
/// <summary>The middle mouse button is down.</summary>
MK_MBUTTON = 0x0010,
/// <summary>The XBUTTON1 button is down.</summary>
MK_XBUTTON1 = 0x0020,
/// <summary>The XBUTTON2 button is down.</summary>
MK_XBUTTON2 = 0x0040,
}
/// <summary>Controls various aspects of mouse motion and button clicking.</summary>
[PInvokeData("winuser.h", MSDNShortId = "")]
[Flags]

View File

@ -88,7 +88,7 @@ namespace Vanara.Windows.Shell
/// <summary>Gets a value based on the current state of the keys CTRL and SHIFT.</summary>
/// <value>The value based on the current state of the keys CTRL and SHIFT.</value>
public User32.MouseButtonState KeyState { get; private set; }
public MouseButtonState KeyState { get; private set; }
/// <summary>Gets a new working directory. This value is <see langword="null"/> if the current working directory is to be used.</summary>
/// <value>Returns a <see cref="string"/> value.</value>
@ -149,7 +149,7 @@ namespace Vanara.Windows.Shell
}
/// <inheritdoc/>
HRESULT IExecuteCommand.SetKeyState(User32.MouseButtonState grfKeyState)
HRESULT IExecuteCommand.SetKeyState(MouseButtonState grfKeyState)
{
KeyState = grfKeyState;
return HRESULT.S_OK;