<html><head>
<HTA:APPLICATION
ID="Group Lister"
APPLICATION="YES"
APPLICATIONNAME="Windows MCE Pause Buffer Settings"
SCROLL="no"
maximizeButton="no"
version="1.0"
SINGLEINSTANCE="yes"
WINDOWSTATE="normal">
<title>Windows MCE Pause Buffer Settings</title>
<style>
BODY{background-color: buttonface;font-family: Helvetica;font-size:
8pt;margin-top: 10px;margin-left: 10px;
margin-right: 10px; margin-bottom: 10px;}
..button{ font-family: Helvetica; font-size: 8pt;}
..button_strings{ font-family: Helvetica; font-size: 8pt; width: 75px;}
select{font-family: arial; font-size: 10pt; width: 150px; margin-left:
0px;}
TABLE { xfont-family:"Arial"; xfont-size:8pt; font:menu; padding:0pt;
border:0pt; }
IFrame { height:expression(document.body.clientHeight-
MenuTable.clientHeight); width:100%; }
</style>
<script language="vbscript"></script>
</head>
<body>
<form id="inputform" name="inputform">
</table><Table border="0" Width="100%">
<input id=quit button class="button" type="button" value="Quit"
name="quit_button"
onClick="Window_Onclose()" title="Quit program">
<HR><div ID=Choosegroup></div>
<div ID=pausetime></div>
</td>
</form>
</body>
</html>
<script language="vbscript">
'========================================================================
==
'
' VBScript Source File -- Windows MCE Pause Buffer Settings
'
'
' Copyright© 2006. TeleData Consulting, Inc. All rights reserved
' You are welcome to distribute this freely - use at your own risk!
'
' AUTHOR: Paul Drangeid,
http://www.tdonline.com
' DATE : 1/16/06
'
'========================================================================
==
' *********** Declare Variables, and Set default values
dim objRegistry,strvalue
Const HKEY_CURRENT_USER = &H80000001
Const HKEY_LOCAL_MACHINE = &H80000002
StrComputer = "."
Set objRegistry = GetObject("winmgmts:\\" & _
strComputer & "\root\default:StdRegProv")
Sub Window_OnClose()
Self.close()
End Sub
Sub Window_Onload
targetWidth = 300
targetHeight = 230
'self.ResizeTo 1,1
'self.MoveTo window.screen.availWidth - targetWidth, 0
'self.ResizeTo window.screen.availWidth - targetWidth, 0
self.ResizeTo targetWidth,targetHeight
self.Focus()
End Sub
strhtm=strhtm+"  BackingFileDuration:     
<select id="&qc&"chduration"&qc&" name="&qc&"chduration"&qc&"
Onchange="&qc&"Updatetime"&qc&">" '
strhtm=strhtm+"<option value=300>"& "300k (default)"
strhtm=strhtm+"<option value=600>"& "600k"
strhtm=strhtm+"<option value=900>"& "900k"
strhtm=strhtm+"<option value=1200>"& "1200k"
strhtm=strhtm+"</select> <BR>"
strhtm=strhtm+"  BackingFileCountHigh:  <select
id="&qc&"chcount"&qc&" name="&qc&"chcount"&qc&"
Onchange="&qc&"Updatetime"&qc&">" '
strhtm=strhtm+"<option value=6>"& "6 (default)"
strhtm=strhtm+"<option value=8>"& "8"
strhtm=strhtm+"<option value=10>"& "10"
strhtm=strhtm+"<option value=12>"& "12"
strhtm=strhtm+"<option value=14>"& "14"
strhtm=strhtm+"<option value=16>"& "16"
strhtm=strhtm+"</select> <BR>"
strhtm=strhtm+"<input value='Save' type="&qc&"button"&qc&" id='GO'
onclick="&qc&"setpause"&qc&">"
choosegroup.innerhtml=strhtm
if not isKey("HKEY_LOCAL_MACHINE","Software\Microsoft\Windows
\CurrentVersion\Media Center") then
msgbox "This utility is only for Windows XP: Media Center
Edition",0,"Media Center Edition not found."
self.close
end if
if isvalue("HKEY_LOCAL_MACHINE","Software\Microsoft\Windows
\CurrentVersion\Media Center\Service\Video\Tuners","BackingFileDuration")
then
set objtmp=document.all("chduration")
objtmp.value=strvalue
'msgbox strvalue,0,"BackingFileDuration"
end if
if isvalue("HKEY_LOCAL_MACHINE","Software\Microsoft\Windows
\CurrentVersion\Media Center\Service\Video
\Tuners","BackingFileCountHigh") then
set objtmp=document.all("chcount")
objtmp.value=strvalue
'msgbox strvalue,0,"BackingFileCountHigh"
end if
call updatetime
Sub Updatetime()
strsize=document.all("chduration").value
strcount=document.all("chcount").value
strtotal=strsize*strcount
strhtm="Pause Buffer Time: "&strtotal/60&"min ("&int((strtotal/60)/60)
&"hrs "
strhtm=strhtm& ((strtotal/60) - (int((strtotal/60)/60))*60) &" mins)"
pausetime.innerhtml=strhtm
End Sub
Function Iskey(strhive,strkeypath)
strhive=ucase(strhive)
if strhive<>"HKEY_CURRENT_USER" and strhive <> "HKEY_LOCAL_MACHINE" then
IsKey="False":exit function
IsKey="False"
intx=InstrRev(strkeypath,"\")
if intx=0 then exit function
strkey=mid(strkeypath,intx+1,len(strkeypath)-intx)
strrootkey=left(strkeypath,intx-1)
if strhive="HKEY_CURRENT_USER" then objRegistry.EnumKey
HKEY_CURRENT_USER, strrootKey, arrSubKeys
if strhive="HKEY_LOCAL_MACHINE" then objRegistry.EnumKey
HKEY_LOCAL_MACHINE, strrootKey, arrSubKeys
if isarray(arrSubkeys) then
for x =lbound(arrSubkeys) to ubound(arrSubkeys)
if ucase(arrSubKeys(x))=ucase(strkey) then IsKey="True"
next 'x
else
if instr(ucase(arrSubkeys),ucase(strkey))<>0 then IsKey="True"
end if
end function
Function IsValue(strhive,key,valname)
strvalue=""
strhive=ucase(strhive)
if strhive<>"HKEY_CURRENT_USER" and strhive <> "HKEY_LOCAL_MACHINE" then
Isvalue="False":exit function
if strhive="HKEY_CURRENT_USER" then objRegistry.GetdwordValue
HKEY_CURRENT_USER,Key,ValName,strValue
if strhive="HKEY_LOCAL_MACHINE" then objRegistry.GetdwordValue
HKEY_LOCAL_MACHINE,Key,ValName,strValue
'msgbox "Get HKLM "&","&key&","&valname&","&strvalue
If IsNull(strValue) Then IsValue=False Else IsValue=True
End Function
Sub CreateRegKeys(strKeyPath,strvaluename,strvalue)
objRegistry.CreateKey HKEY_LOCAL_MACHINE,strKeyPath
if err.number <> 0 then
msgbox "Error Write: " & cstr(err.number) & "(" & err.Description & ")"
end if
if strvaluename<>"" and strvalue<>"" then
if instr(strValue,"dword:")=0 then
objRegistry.SetStringValue HKEY_LOCAL_MACHINE, strKeyPath, strValueName,
strValue
else
strvalue=right(strvalue,len(strvalue)-6)
'msgbox strvaluename&"="&strvalue
objRegistry.SetdwordValue HKEY_LOCAL_MACHINE, strKeyPath, strValueName,
strValue
end if
end if
End Sub
sub SetPause
strsize=document.all("chduration").value
strcount=document.all("chcount").value
call CreateRegKeys("Software\Microsoft\Windows\CurrentVersion\Media
Center\Service\Video\Tuners","BackingFileDuration","dword:"&strsize)
call CreateRegKeys("Software\Microsoft\Windows\CurrentVersion\Media
Center\Service\Video\Tuners","BackingFileCountHigh","dword:"&strcount)
msgbox "Pause Buffer Updated"&vbcrlf& "You must reboot for Changes to
take affect.",0,"Success!"
end sub
</script>
Bookmarks