mirror of
https://github.com/Hofknecht/SystemTrayMenu.git
synced 2024-10-03 10:36:30 +13:00
26 lines
812 B
C#
26 lines
812 B
C#
// <copyright file="IsTouchEnabled.cs" company="PlaceholderCompany">
|
|
// Copyright (c) PlaceholderCompany. All rights reserved.
|
|
// </copyright>
|
|
|
|
namespace SystemTrayMenu.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);
|
|
}
|
|
}
|