SystemTrayMenu/NativeDllImport/IsTouchEnabled.cs

19 lines
449 B
C#
Raw Normal View History

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;
}
}
}