473,385 Members | 1,610 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

How do I get system Info such as OS

Al
Hi,
I like to know if my application is running on Tablet PC or not and based on
that behave differently. How would I know if the system is Tablet PC or not?

Thanks so much in advance

Al

Nov 21 '05 #1
12 5071
"=?Utf-8?B?QWw=?=" <Al@discussions.microsoft.com> wrote in
news:A4**********************************@microsof t.com:
Hi,
I like to know if my application is running on Tablet PC or not and
based on that behave differently. How would I know if the system is
Tablet PC or not?

You can always use WMI... WMI can query just about any system information.

There maybe an easier way, but WMI is probably the most comprehensive.
--
Lucas Tam (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/
Nov 21 '05 #2
Al
How do I query WMI for Operating system type?

"Lucas Tam" wrote:
"=?Utf-8?B?QWw=?=" <Al@discussions.microsoft.com> wrote in
news:A4**********************************@microsof t.com:
Hi,
I like to know if my application is running on Tablet PC or not and
based on that behave differently. How would I know if the system is
Tablet PC or not?

You can always use WMI... WMI can query just about any system information.

There maybe an easier way, but WMI is probably the most comprehensive.
--
Lucas Tam (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/

Nov 21 '05 #3
"=?Utf-8?B?QWw=?=" <Al@discussions.microsoft.com> wrote in
news:51**********************************@microsof t.com:
How do I query WMI for Operating system type?


Here's the reference for WMI:

http://msdn.microsoft.com/library/de...l=/library/en-
us/wmisdk/wmi/wmi_reference.asp

Sample on using WMI with Vb.NET:
http://www.freevbcode.com/ShowCode.asp?ID=4571

WMI is pretty neat... you can query WMI via .NET like a SQL database. The
trickiest part with WMI is to find the proper object to query.

You might want to try the class Win32_ComputerSystemProduct. I think the
info your looking for maybe in there:

http://msdn.microsoft.com/library/de...l=/library/en-
us/wmisdk/wmi/win32_computersystemproduct.asp
--
Lucas Tam (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/
Nov 21 '05 #4
Al
Thank Lucas, I did query the WMI I used the following attributes:

"name" for ComputerName
"version"
"csname" Operating system name
"systemtype"
...
I ran it on my desktop as well as my tablet PC....

Unfortunatly none of these tell me about Tablet PC. The OS name for tablet
PC and regular Desktop is reported as Windows XP. I am not sure which
attributes (if any) contains info about tablet PC.

Thanks again for the help.

Al

"Lucas Tam" wrote:
"=?Utf-8?B?QWw=?=" <Al@discussions.microsoft.com> wrote in
news:51**********************************@microsof t.com:
How do I query WMI for Operating system type?


Here's the reference for WMI:

http://msdn.microsoft.com/library/de...l=/library/en-
us/wmisdk/wmi/wmi_reference.asp

Sample on using WMI with Vb.NET:
http://www.freevbcode.com/ShowCode.asp?ID=4571

WMI is pretty neat... you can query WMI via .NET like a SQL database. The
trickiest part with WMI is to find the proper object to query.

You might want to try the class Win32_ComputerSystemProduct. I think the
info your looking for maybe in there:

http://msdn.microsoft.com/library/de...l=/library/en-
us/wmisdk/wmi/win32_computersystemproduct.asp
--
Lucas Tam (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/

Nov 21 '05 #5
Al
Lucas i would like to explore Win32_ComputerSystemProduct as you sugested but
where would i get the objects it contains... most of your links to MSDN for
some reason wont work for me.
thanks again

"Lucas Tam" wrote:
"=?Utf-8?B?QWw=?=" <Al@discussions.microsoft.com> wrote in
news:51**********************************@microsof t.com:
How do I query WMI for Operating system type?


Here's the reference for WMI:

http://msdn.microsoft.com/library/de...l=/library/en-
us/wmisdk/wmi/wmi_reference.asp

Sample on using WMI with Vb.NET:
http://www.freevbcode.com/ShowCode.asp?ID=4571

WMI is pretty neat... you can query WMI via .NET like a SQL database. The
trickiest part with WMI is to find the proper object to query.

You might want to try the class Win32_ComputerSystemProduct. I think the
info your looking for maybe in there:

http://msdn.microsoft.com/library/de...l=/library/en-
us/wmisdk/wmi/win32_computersystemproduct.asp
--
Lucas Tam (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/

Nov 21 '05 #6
Hi,

Take a look at systeminformation.penwindows.

http://msdn.microsoft.com/library/de...ndowsTopic.asp

Ken
---------------------------
"Al" <Al@discussions.microsoft.com> wrote in message
news:A4**********************************@microsof t.com...
Hi,
I like to know if my application is running on Tablet PC or not and based on
that behave differently. How would I know if the system is Tablet PC or not?

Thanks so much in advance

Al
Nov 21 '05 #7
* "=?Utf-8?B?QWw=?=" <Al@discussions.microsoft.com> scripsit:
I like to know if my application is running on Tablet PC or not and based on
that behave differently. How would I know if the system is Tablet PC or not?


Untested:

Maybe 'Environment.OSVersion' provides enough information for your
needs.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Nov 21 '05 #8
"=?Utf-8?B?QWw=?=" <Al@discussions.microsoft.com> wrote in news:CA23BB08-
8B*************************@microsoft.com:
most of your links to MSDN for
some reason wont work for me.


Try copy and pasting the links manually. The links run onto two lines.

--
Lucas Tam (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/
Nov 21 '05 #9
* Lucas Tam <RE********@rogers.com> scripsit:
most of your links to MSDN for
some reason wont work for me.


Try copy and pasting the links manually. The links run onto two lines.


Just a thought: Why not install the mondo patch which will prevent OE
from breaking long links?

OLEXP: An Overview of the Cumulative Update for Outlook Express 6.0 SP1
<URL:http://support.microsoft.com/?scid=kb;EN-US;331923>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Nov 21 '05 #10
* "=?Utf-8?B?QWw=?=" <Al@discussions.microsoft.com> scripsit:
In both system it reported as WIndows NT and nothing about Tablet PC.


OK, I could not check that without a tablet PC :-).

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Nov 21 '05 #11
Al,
According to the Microsoft Tablet PC SDK:

<quote>
Q. How can I determine if my application is running on a Tablet PC?
A. Use the Windows GetSystemMetrics API and pass in SM_TABLETPC as the value
of the index. SM_TABLETPC is defined in Winuser.h. The value of SM_TABLETPC
is 86. The method returns True or nonzero if the Microsoft Windows XP Tablet
PC Edition operating system is running; False or zero otherwise.

Applications should not rely on a true or nonzero value to mean all Tablet
PC components are installed and working. See the following question for
details on how to determine if Tablet PC components are installed.

</quote>

I would expect System.Windows.Forms.SystemInformation would list the value
as it gives most other SystemMetrics, however it appears to be missing
TabletPC (SM_TABLETPC).

You can use code similar to:

Public Enum SystemMetric As Integer
TabletPC = 86
End Enum

Declare Auto Function GetSystemMetrics Lib "User32" (ByVal index As
SystemMetric) As Integer

If GetSystemMetrics(SystemMetric.TabletPC) <> 0 Then
Debug.WriteLine("On a Tablet PC")
Else
Debug.WriteLine("Not on a Tablet PC")
End If

Hope this helps
Jay

"Al" <Al@discussions.microsoft.com> wrote in message
news:A4**********************************@microsof t.com...
Hi,
I like to know if my application is running on Tablet PC or not and based
on
that behave differently. How would I know if the system is Tablet PC or
not?

Thanks so much in advance

Al

Nov 21 '05 #12
Hi,

Looked in the Tablet PC SDK. Says to use GetSystemMetrics API to
determine if program is running on a tabletpc.

Declare Function GetSystemMetrics Lib "user32" Alias "GetSystemMetrics" _

(ByVal nIndex As Integer) As Integer

Private Const SM_TABLETPC As Integer = 86

If GetSystemMetrics(SM_TABLETPC) <> 0 Then

MessageBox.Show("Tablet PC")

Else

MessageBox.Show("Non Tablet")

End If

Ken

-----------------------------------

"Al" <Al@discussions.microsoft.com> wrote in message
news:A1**********************************@microsof t.com...
Hi Ken,
I did use PenWindows the value i am getting is false both on Tablet PC as
well as XP running on desktop!
Thanks
Al

"Ken Tucker [MVP]" wrote:
Hi,

Take a look at systeminformation.penwindows.

http://msdn.microsoft.com/library/de...ndowsTopic.asp

Ken
---------------------------
"Al" <Al@discussions.microsoft.com> wrote in message
news:A4**********************************@microsof t.com...
Hi,
I like to know if my application is running on Tablet PC or not and based
on
that behave differently. How would I know if the system is Tablet PC or
not?

Thanks so much in advance

Al

Nov 21 '05 #13

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Valiz | last post by:
Hi, I am updating system time with IRIG time source which sends irregular pulses as shown below 11000011111100111111111111111111....(1-IRIG present and 0-IRIG not present) I need to update...
0
by: Daniel Reber | last post by:
I am trying to start a process from a windows service but when the process starts the command window that the process runs in never shows. Is this because I am calling it from a windows service? ...
2
by: Chris Langston | last post by:
I have a Web Server running IIS 5 or 6 on Windows 2K and Windows 2003 Server that is experiencing strange shutdown problems. We are using ASP.NET v1.1 and our application is written in VB.NET ...
5
by: Lance | last post by:
I want to expose properties of a class to a user via a PropertyGrid class. Some of the properties are of type System.IO.FileInfo. Ideally, an OpenFileDialog window would appear when the user...
10
by: Herby | last post by:
I seem to be having a problem with System namespace. There seem to two System namepaces when viewing through Object browser within .NET 2005. One global System:: Then one under <mscorlib> Each...
0
by: Daniel | last post by:
C# windows service freezes on System.Diagnostics.Process.Start(info) When I launch PSCP from a C# windows service and launch pscp 0.53 there are no issues. but when I use C# windows service to...
4
by: George | last post by:
Hi, I am puzzled by the following and seeking some assistance to help me understand what happened. I have very limited encoding knowledge. Our SAP system writes out a text file which includes...
0
by: kimiraikkonen | last post by:
On Jul 11, 10:07 pm, Michael<mtit...@bigfoot.comwrote: Hi Michael, There are several ways of retrieving, but some low-level hardware info is retrieved using WMI. To get basic system info such as...
5
by: Henry Stock | last post by:
I am trying to understand the following error: Any thing you can tell me about this is appreciated. Security Exception Description: The application attempted to perform an operation not allowed...
7
hsn
by: hsn | last post by:
hello everyone. i am trying to use the system.setproperty to set the proxy in my computer. public static void main(String args) { // TODO Auto-generated method stub ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.