Skip to content
This repository has been archived by the owner on Jul 26, 2023. It is now read-only.

Commit

Permalink
GetLastInputInfo - PR Feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
NotCoffee418 committed Nov 27, 2020
1 parent e041e09 commit ac44163
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
4 changes: 3 additions & 1 deletion src/User32/PublicAPI.Unshipped.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ static extern PInvoke.User32.EnumDisplaySettingsEx(char* lpszDeviceName, uint iM
static extern PInvoke.User32.LoadString(System.IntPtr hInstance, uint uID, char* lpBuffer, int cchBufferMax) -> int
static extern PInvoke.User32.UnregisterClass(string lpClassName, System.IntPtr hInstance) -> bool
static readonly PInvoke.User32.DPI_AWARENESS_CONTEXT_UNAWARE_GDISCALED -> System.IntPtr
static extern PInvoke.User32.GetLastInputInfo(ref PInvoke.User32.LASTINPUTINFO plii) -> bool
static PInvoke.User32.GetLastInputInfo(System.IntPtr plii) -> bool
static PInvoke.User32.GetLastInputInfo(out PInvoke.User32.LASTINPUTINFO plii) -> bool
static extern PInvoke.User32.GetLastInputInfo(PInvoke.User32.LASTINPUTINFO* plii) -> bool
PInvoke.User32.LASTINPUTINFO
PInvoke.User32.LASTINPUTINFO.LASTINPUTINFO() -> void
PInvoke.User32.LASTINPUTINFO.cbSize -> int
Expand Down
9 changes: 2 additions & 7 deletions src/User32/User32+LASTINPUTINFO.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace PInvoke
public partial class User32
{
/// <summary>
/// Contains the time of the last input. It is used with the <see cref="GetLastInputInfo"/> function.
/// Contains the time of the last input. It is used with the <see cref="GetLastInputInfo(LASTINPUTINFO*)"/> function.
/// </summary>
public struct LASTINPUTINFO
{
Expand All @@ -30,12 +30,7 @@ public struct LASTINPUTINFO
/// Initializes a new instance of the <see cref="LASTINPUTINFO"/> struct.
/// </summary>
/// <returns>An initialized instance of the struct.</returns>
public static LASTINPUTINFO Create()
{
var nw = default(LASTINPUTINFO);
nw.cbSize = Marshal.SizeOf(typeof(LASTINPUTINFO));
return nw;
}
public static unsafe LASTINPUTINFO Create() => new LASTINPUTINFO { cbSize = sizeof(LASTINPUTINFO) };
}
}
}
5 changes: 3 additions & 2 deletions src/User32/User32.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3960,9 +3960,10 @@ public static unsafe extern uint MsgWaitForMultipleObjectsEx(
/// In some cases, the value might be less than the tick count of a prior event. For example, this can be caused by
/// a timing gap between the raw input thread and the desktop thread or an event raised by SendInput, which supplies its own tick count.
/// </remarks>
[DllImport(nameof(User32), SetLastError = true, EntryPoint = "GetLastInputInfo")]
[DllImport(nameof(User32))]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool GetLastInputInfo(ref LASTINPUTINFO plii);
public static extern unsafe bool GetLastInputInfo(
[Friendly(FriendlyFlags.Out)] LASTINPUTINFO* plii);

/// <summary>
/// The BeginPaint function prepares the specified window for painting and fills a <see cref="PAINTSTRUCT"/> structure with information about the painting.
Expand Down

0 comments on commit ac44163

Please sign in to comment.