啊啊啊啊啊,还是由于“特殊项目”的需要,需要对平板是否在平板模式下工作进行判断。一开始也是找到一个方案,就是这个
public static class TabletPCSupport
{
private static readonly int SM_CONVERTIBLESLATEMODE = 0x2003;
private static readonly int SM_TABLETPC = 0x56;
private Boolean isTabletPC = false;
public Boolean SupportsTabletMode { get { return isTabletPC; }}
public Boolean IsTabletMode
{
get
{
return QueryTabletMode();
}
}
static TabletPCSupport ()
{
isTabletPC = (GetSystemMetrics(SM_TABLETPC) != 0);
}
[DllImport(“user32.dll”, SetLastError = true, CharSet = CharSet.Auto, EntryPoint = “GetSystemMetrics”)]
private static extern int GetSystemMetrics (int nIndex);
private static Boolean QueryTabletMode ()
{
int state = GetSystemMetrics(SM_CONVERTIBLESLATEMODE);
return (state == 0) &&