Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

93 lines
2.5 KiB

<PUBLIC:COMPONENT lightweight>
<PUBLIC:ATTACH event="ondocumentready" onevent="onDocumentReady();" />
<PUBLIC:ATTACH event="onkeydown" onevent="HandleShortcuts();" />
<PUBLIC:ATTACH event="ondragstart" onevent="OnDragStart();" />
<PUBLIC:ATTACH event="ondragenter" onevent="OnDragStart();" />
</PUBLIC:COMPONENT>
<SCRIPT language="JavaScript">
function ErrorHandler(szMsg)
{
alert(szMsg);
event.returnValue = true;
}
function onDocumentReady()
{
window.onerror = ErrorHandler;
var css = top.window.g_strThemeCSS;
if (!css)
{
css = "none";
try
{
var oThemeManager = new ActiveXObject("Theme.Manager");
var szTheme = oThemeManager.GetSelectedSchemeProperty("Path");
if (szTheme)
{
var szColor = oThemeManager.GetSelectedSchemeProperty("Color");
//alert("ThemeManager returned " + szTheme); // for debugging only
if (szColor)
css = "res://" + szTheme + "\\Shell\\" + szColor + "\\ShellStyle.dll/cpwebvw.css";
}
}
catch (e)
{
//alert("ThemeManager error " + e.number); // for debugging only
}
top.window.g_strThemeCSS = css;
}
if (css != "none")
window.document.createStyleSheet(css);
}
function HandleShortcuts()
{
var code = event.keyCode;
if (event.altKey == true)
{
switch (code)
{
case 36: // VK_HOME
top.window.g_Navigator.back(-1);
event.returnValue = false;
break;
case 37: // VK_LEFT
top.window.g_Navigator.back();
event.returnValue = false;
break;
case 39: // VK_RIGHT
top.window.g_Navigator.forward();
event.returnValue = false;
break;
}
}
// ctrl-P brings up the print dialog by default
if (event.ctrlKey == true && code == 80) // 'P'
event.returnValue = false;
// 'refresh'
if (code == 116) // VK_F5
{
// Force a new enumeration and go back to the first page.
g_oSelectedUser = null;
g_oUserList = null;
g_oUserList = new ActiveXObject("Shell.Users");
top.window.g_Navigator.back(-1);
event.returnValue = false;
}
}
// Don't want any drag-drop stuff going on
function OnDragStart()
{
event.returnValue = false;
}
</SCRIPT>