Jump to content

How to detrmine if running Tablet PC version of XP?


 Share

Recommended Posts

I need to determine if a machine is running the TabletPC version of Windows XP.

The AUtoIt macros just report Windows XP.

I came across a solution which requires linking to a DLL file. I have no experience whatsoever with it.

I have installed the newest AutoIt beta because I know it is able to link to DLL files but I don't know what to do with ti :lmao:

Here is the C++ code. WOuld anyone be able to port this to Autoit code? Thanks!

Here is what I found online:

Import User32.dll and then call GetSystemMetrics with the value '86'.

const int SM_TABLETPC = 86; 
[DllImport("user32.dll")] 
private static extern int GetSystemMetrics(int nIndex); 

private void btnIsTablet_Click(object sender, System.EventArgs e) 
{ 
 if (GetSystemMetrics(SM_TABLETPC) != 0) 
  MessageBox.Show("Yes, this IS a tablet"); 
 else 
  MessageBox.Show("No, this IS NOT a tablet"); 
}

Make sure you add "using System.Runtime.InteropServices;"

Link to comment
Share on other sites

OK, I think figured it out :lmao:

Dim $result
Const $TabletPC = 86

$result = DllCall ( 'user32.dll', 'int', 'GetSystemMetrics', 'int', $TabletPC )

If $result[0] = 1 Then
    MsgBox ( 0, 'Debug', 'TabletPC!' )
Else
    MsgBox ( 0, 'Debug', 'NOT TabletPC!' )
EndIf
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...