SystemTrayMenu/NativeDllImport/IsTouchEnabled.cs
Markus Hofknecht f867894a1e #113, version 0.11.1.10
[Feature] Bigger buttons for Touch #113
2020-06-27 12:37:52 +02:00

19 lines
449 B
C#

using System.Runtime.InteropServices;
namespace SystemTrayMenu.DllImports
{
public static partial class NativeMethods
{
[DllImport("user32.dll")]
private static extern int GetSystemMetrics(int nIndex);
public static bool IsTouchEnabled()
{
const int MAXTOUCHES_INDEX = 95;
int maxTouches = GetSystemMetrics(MAXTOUCHES_INDEX);
return maxTouches > 0;
}
}
}