mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 11:48:06 +01:00
* Remove redundant default initializations * Implement IDisposable in HotkeySettingsControl * Mark classes and methods as static * Move Interop.ShowWindow to NativeMethods class * Fix string-related warnings * Remove unused argument for KeyEventHandler * Log caught general exceptions * Use safe navigation operator for null argument checks * Suppress CA2007 warnings and enable FxCop * Suppress warning for unused event handler params * Use TryParse in ImageResizerPage * Use ConfigureAwait(false) for CA2007
21 lines
784 B
C#
21 lines
784 B
C#
// Copyright (c) Microsoft Corporation
|
|
// The Microsoft Corporation licenses this file to you under the MIT license.
|
|
// See the LICENSE file in the project root for more information.
|
|
|
|
using System.Runtime.InteropServices;
|
|
|
|
namespace Microsoft.PowerToys.Settings.UI.Helpers
|
|
{
|
|
internal static class NativeMethods
|
|
{
|
|
[DllImport("user32.dll")]
|
|
internal static extern uint SendInput(uint nInputs, NativeKeyboardHelper.INPUT[] pInputs, int cbSize);
|
|
|
|
[DllImport("user32.dll", CharSet = CharSet.Auto, CallingConvention = CallingConvention.StdCall, SetLastError = true)]
|
|
internal static extern short GetAsyncKeyState(int vKey);
|
|
|
|
[DllImport("user32.dll")]
|
|
public static extern bool ShowWindow(System.IntPtr hWnd, int nCmdShow);
|
|
}
|
|
}
|