Indigo Rose Software
  #1  
Old 09-17-2004
Ted Sullivan's Avatar
Ted Sullivan Ted Sullivan is offline
Indigo Rose Staff Member
 
Join Date: Oct 2003
Posts: 825
Lightbulb Function: IsRunningOnTabletPC

Function: IsRunningOnTabletPC
Last Revision: September 17, 2004 (001)

Information
This function can be used to determine if the host operating system is running Window XP Tablet PC Edition.

To use this function in your Setup Factory 7.0 projects, simply copy and paste it into your Global Functions. You can get there by selecting Resources > Global Functions from the main menu.

Code:
function IsRunningOnTabletPC()
	local strRet = DLL.CallFunction(_SystemFolder.."\\user32.dll","GetSystemMetrics",86,DLL_RETURN_TYPE_INTEGER,DLL_CALL_STDCALL);
	local nLastError = Application.GetLastError();
	if(nLastError == 0) then
		if(strRet ~= "0") then
			return true;
		end
	end
	return false;
end
To call the function from your project, try copying and pasting the following script onto an action tab, such as the On Startup event. You can get there by choosing Project > Actions.
Code:
if (IsRunningOnTabletPC()) then
	Dialog.Message("Status","This system is running Windows XP Tablet PC Edition");
else
	Dialog.Message("Status","This system is NOT running Windows XP Tablet PC Edition");
end
Function Name: IsRunningOnTabletPC
Type: Setup Factory 7.0 Function
Created By: Brett Kapilik

Comments? Please post them here.
Reply With Quote
  #2  
Old 01-30-2006
Eagle Eagle is offline
Indigo Rose Customer
 
Join Date: Mar 2005
Location: WA 'wait a while' - Australia
Posts: 827
Here is a small modification to Brett's Code,
it allows for additional Os version detection:

"Windows XP Media Center Edition"
"Windows Server 2003 - Revision 2"

Code:
function IsRunningOnTargetPC(ntype)
	local strRet = DLL.CallFunction(_SystemFolder.."\\user32.dll","GetSystemMetrics",ntype,DLL_RETURN_TYPE_INTEGER,DLL_CALL_STDCALL);
	local nLastError = Application.GetLastError();
	if(nLastError == 0) then
		if(strRet ~= "0") then
			return true;
		end
	end
	return false;
end


--[[Set your additional Os targets to detect(uncomment only, your target OS code line)]]

local ntype = 86; local strOs = "Windows XP Tablet PC Edition";
--local ntype = 87; local strOs = "Windows XP Media Center Edition";
--local ntype = 89; local strOs = "Windows Server 2003 - Revision 2";

if (IsRunningOnTargetPC(ntype)) then
	Dialog.Message("Status","This system is running "..strOs);
else
	Dialog.Message("Status","This system is NOT running "..strOs);
end
Reply With Quote
  #3  
Old 06-19-2006
Eagle Eagle is offline
Indigo Rose Customer
 
Join Date: Mar 2005
Location: WA 'wait a while' - Australia
Posts: 827
Caution: testing at my end on Vista Beta 2(ultimate edition),

if you apply tests for:
--local ntype = 86; local strOs = "Windows XP Tablet PC Edition";
--local ntype = 87; local strOs = "Windows XP Media Center Edition";

you will find that results are 'true' for vista - ultimate edition
as functionality for both is imbedded for vista -ultimate

just a heads up for now, if developing for NT6
Reply With Quote
  #4  
Old 06-19-2006
Tek Tek is offline
Forum Member
 
Join Date: Mar 2004
Location: Toronto, ON CANADA
Posts: 691
Thanks for the example Ted!

On a side note, has anyone got a list of all the known values for 'ntype' and their associated operating system string values?
Reply With Quote
  #5  
Old 06-24-2006
Eagle Eagle is offline
Indigo Rose Customer
 
Join Date: Mar 2005
Location: WA 'wait a while' - Australia
Posts: 827
Correction for applying tests on Vista - Ultimate.

"Tablet Pc Edition" is Not returned true for this Os,
however the below has been reverified:

if you apply a test for:
--local ntype = 87; local strOs = "Windows XP Media Center Edition";

you will find that result is returned 'true' for Vista - Ultimate edition
as functionality for Media Center is imbedded for vista -ultimate

just a heads up for now, if developing for NT6
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Bizarre Callback Function Behaviour - Can anyone help? SRJ AutoPlay Media Studio 5.0 3 06-30-2004 10:16 PM
Function: Validate the Contents of an Input Object Lorne AutoPlay Media Studio 5.0 Examples 2 06-17-2004 09:47 AM
Function: Test Whether An Input Object Is Empty Lorne AutoPlay Media Studio 5.0 Examples 0 06-08-2004 03:18 PM
Function: Increase/Decrease Audio Playback Volume Adam AutoPlay Media Studio 5.0 Examples 0 05-31-2004 03:28 PM
Function: Resize & Center an Image kpsmith AutoPlay Media Studio 5.0 Examples 0 05-17-2004 02:36 PM


All times are GMT -6. The time now is 02:50 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Copyright © 2000 - 2009 Indigo Rose Corporation. All rights reserved.
Indigo Rose Software