v1.2
This commit is contained in:
26
FSI.BT.Tools/Global/DllImport/IsTouchEnabled.cs
Normal file
26
FSI.BT.Tools/Global/DllImport/IsTouchEnabled.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
// <copyright file="IsTouchEnabled.cs" company="PlaceholderCompany">
|
||||
// Copyright (c) PlaceholderCompany. All rights reserved.
|
||||
// </copyright>
|
||||
|
||||
namespace FSI.BT.Tools.Global.DllImports
|
||||
{
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
/// <summary>
|
||||
/// wraps the methodcalls to native windows dll's.
|
||||
/// </summary>
|
||||
public static partial class NativeMethods
|
||||
{
|
||||
public static bool IsTouchEnabled()
|
||||
{
|
||||
const int MAXTOUCHES_INDEX = 95;
|
||||
int maxTouches = GetSystemMetrics(MAXTOUCHES_INDEX);
|
||||
|
||||
return maxTouches > 0;
|
||||
}
|
||||
|
||||
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
|
||||
[DefaultDllImportSearchPaths(DllImportSearchPath.UserDirectories)]
|
||||
private static extern int GetSystemMetrics(int nIndex);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user