你的系统遇到了一个无法处理的错误,需要重新启动。
*** STOP: 0x0000007B (0xF78D2524, 0xC0000034, 0x00000000, 0x00000000)
*** INACCESSIBLE_BOOT_DEVICE
如果你第一次看到此界面,请重新启动计算机。如果多次出现,请运行磁盘清理或恢复出厂设置。
您可以在窗口中查看我
' }); } // 保存文件系统 saveFileSystem(); } // ====== 新增代码结束 ====== // 更新开始菜单头像和名字 const startAvatar = document.getElementById('start-avatar'); const startUsername = document.getElementById('start-username'); if (startAvatar) startAvatar.textContent = user.avatar || '👤'; if (startUsername) startUsername.textContent = user.name; // 注销功能 const logoutBtn = document.getElementById('logout-btn'); const logoutText = logoutBtn?.nextElementSibling; // 获取旁边的文字 const performLogout = () => { document.getElementById('start-menu').classList.remove('active'); if (typeof switchUser === 'function') { switchUser(); } else { showLoginScreen(); } }; logoutBtn?.addEventListener('click', performLogout); logoutText?.addEventListener('click', performLogout); // 关机功能 const shutdownBtn = document.getElementById('shutdown-btn'); const shutdownText = shutdownBtn?.nextElementSibling; const performShutdown = () => { document.getElementById('start-menu').classList.remove('active'); showShutdownChoices(); }; shutdownBtn?.addEventListener('click', performShutdown); shutdownText?.addEventListener('click', performShutdown); renderDesktopIcons(); // === 新增:登录时同步桌面快捷方式 === console.log('🚀 登录完成,开始同步桌面快捷方式'); syncDesktopShortcuts(); updateStartMenuLeft(); // === 新增:加载用户主题设置 === const savedTheme = getRegistryValue('HKEY_CURRENT_USER\\Control Panel\\Desktop', 'Theme') || 'blue'; applyTheme(savedTheme); const loginDiv = document.getElementById('loginScreen'); if(loginDiv) loginDiv.remove(); performAutoBackup(); const taskbar = document.getElementById('taskbar'); if (taskbar) taskbar.style.display = 'flex'; // 开机自动运行 .reg 中的 HTML 应用 autoRunAtStartup(); }); // ====== 修改结束 ====== } // ========== 新功能:显示关机选择框 ========== function showShutdownChoices() { // ========== 修复:更安全地保存任务栏状态 ========== const taskbar = document.getElementById('taskbar'); if (taskbar) { // 使用 getComputedStyle 确保获取到真正的显示状态,而不是被之前代码污染的状态 taskbar._origDisplay = window.getComputedStyle(taskbar).display; taskbar.style.display = 'none'; } // ========== 修复结束 ========== const shutdownOverlay = document.getElementById('shutdown-overlay'); shutdownOverlay.style.display = 'flex'; shutdownOverlay.classList.add('active'); const choiceOverlay = document.getElementById('shutdown-choice-overlay'); choiceOverlay.classList.add('active'); } // ========== 绑定三个按钮 ========== // 1. 关机 document.getElementById('choice-shutdown').addEventListener('click', () => { playSystemSound('shutdown'); // 关闭所有窗口 windows.forEach(w => w.div.remove()); windows = []; renderTaskbar(); // 隐藏选择框 document.getElementById('shutdown-choice-overlay').classList.remove('active'); // 修改黑白背景为最终关机画面 const overlay = document.getElementById('shutdown-overlay'); overlay.querySelector('div').innerText = "正在关闭 Windows XP..."; overlay.querySelector('.shutdown-text').innerText = "⏻"; }); // 2. 重启 document.getElementById('choice-restart').addEventListener('click', () => { location.reload(); }); // 3. 待机 document.getElementById('choice-standby').addEventListener('click', () => { alert('待机功能模拟。'); document.getElementById('shutdown-choice-overlay').classList.remove('active'); const overlay = document.getElementById('shutdown-overlay'); overlay.classList.remove('active'); overlay.style.display = 'none'; // ========== 修复:强制恢复任务栏显示 ========== const taskbar = document.getElementById('taskbar'); if (taskbar) { taskbar.style.display = 'flex'; delete taskbar._origDisplay; // 清理保存的状态,避免下次出错 } // ========== 修复结束 ========== }); // 4. 取消 document.getElementById('choice-cancel').addEventListener('click', () => { document.getElementById('shutdown-choice-overlay').classList.remove('active'); const overlay = document.getElementById('shutdown-overlay'); overlay.classList.remove('active'); overlay.style.display = 'none'; // ========== 修复:强制恢复任务栏显示 ========== const taskbar = document.getElementById('taskbar'); if (taskbar) { taskbar.style.display = 'flex'; delete taskbar._origDisplay; // 清理保存的状态,避免下次出错 } // ========== 修复结束 ========== }); startBootProgress(false); function switchUser() { users[currentUserId].files = JSON.parse(JSON.stringify(fileSystem)); users[currentUserId].wallpaper = desktop.style.backgroundImage.slice(5,-2)||''; users[currentUserId].shortcuts = desktopShortcuts; saveUsers(); showLoginScreen(); } setTimeout(() => { const startRight = document.querySelector('.start-right'); if(startRight) { const divider = document.createElement('div'); divider.className='menu-divider'; startRight.appendChild(divider); const switchItem = document.createElement('div'); switchItem.className='menu-item'; switchItem.innerHTML='🔄 切换用户'; switchItem.addEventListener('click',(e)=>{ e.stopPropagation(); switchUser(); startMenu.classList.remove('active'); }); startRight.appendChild(switchItem); } },1000); window.addEventListener('beforeunload', () => { if(currentUserId) { let wallpaperUrl = desktop.style.backgroundImage; if(wallpaperUrl && wallpaperUrl.startsWith('url(')) users[currentUserId].wallpaper = wallpaperUrl.slice(5,-2); else users[currentUserId].wallpaper = ''; users[currentUserId].shortcuts = desktopShortcuts; users[currentUserId].files = JSON.parse(JSON.stringify(fileSystem)); saveUsers(); } // ====== 新增:保存关联数据 ====== saveFileAssociations(); saveCustomUploadOptions(); // ====== 新增结束 ====== }); desktopShortcuts = (users[currentUserId]?.shortcuts || []).map(s => { if (!s.id) s.id = generateShortcutId(); return s; }); renderDesktopIcons(); openDB().catch(console.error); // ========== 长按右键菜单功能(修复版:支持桌面空白处 + 应用自定义菜单合并) ========== let longPressTimer = null; let longPressTriggered = false; let touchStartX = 0, touchStartY = 0; const LONG_PRESS_DELAY = 400; const MOVE_THRESHOLD = 10; let clipboard = { type: null, data: null }; document.addEventListener('contextmenu', (e) => { e.preventDefault(); const target = e.target; const x = e.clientX; const y = e.clientY; // ---- 1. 桌面空白处 ---- const isDesktopBlank = (target === desktop || target.classList.contains('desktop-icons') || (target.parentElement === desktop && !target.closest('.desktop-icon, .window, #taskbar, #start-menu'))); if (isDesktopBlank) { showDesktopContextMenu(x, y); return; } // ---- 2. 文件管理器空白处(新增) ---- const contentArea = target.closest('.window-content'); if (contentArea && !target.closest('[data-file-path]')) { const currentPath = contentArea.getAttribute('data-current-path'); if (currentPath) { showFolderContextMenu(currentPath, x, y); return; } } // ---- 3. 其他可交互元素(桌面图标、文件/文件夹、标题栏、开始菜单、任务栏、iframe) ---- const actionable = target.closest('.desktop-icon, [data-file-path], .window-header, #start-menu .menu-item, .task-item, iframe'); if (actionable) { showContextMenu(actionable, x, y); } }); function onTouchStart(e) { const touch = e.touches[0]; touchStartX = touch.clientX; touchStartY = touch.clientY; longPressTriggered = false; if (e.target.closest('.minesweeper-game')) return; const target = e.target; const isDesktopBlank = (target === desktop || target.classList.contains('desktop-icons') || (target.parentElement === desktop && !target.closest('.desktop-icon, .window, #taskbar, #start-menu'))); if (isDesktopBlank) { longPressTimer = setTimeout(() => { longPressTriggered = true; showDesktopContextMenu(touch.clientX, touch.clientY); e.preventDefault(); }, LONG_PRESS_DELAY); } else { const actionable = target.closest('.desktop-icon, .file-open, .explorer-item, .window-header, #start-menu .menu-item, .task-item'); if (!actionable) return; longPressTimer = setTimeout(() => { longPressTriggered = true; showContextMenu(actionable, touch.clientX, touch.clientY); e.preventDefault(); }, LONG_PRESS_DELAY); } } function onTouchMove(e) { if (!longPressTimer) return; const touch = e.touches[0]; const dx = Math.abs(touch.clientX - touchStartX); const dy = Math.abs(touch.clientY - touchStartY); if (dx > MOVE_THRESHOLD || dy > MOVE_THRESHOLD) { clearLongPress(); } } function onTouchEnd(e) { clearLongPress(); } function clearLongPress() { if (longPressTimer) { clearTimeout(longPressTimer); longPressTimer = null; } } // 鼠标左键长按检测(电脑端) let mouseLongPressTimer = null; let mouseLongPressTriggered = false; let mouseStartX = 0, mouseStartY = 0; function onMouseDown(e) { // 只响应左键 if (e.button !== 0) return; // 如果点击在扫雷游戏内,不处理 if (e.target.closest('.minesweeper-game')) return; mouseStartX = e.clientX; mouseStartY = e.clientY; mouseLongPressTriggered = false; const target = e.target; const isDesktopBlank = (target === desktop || target.classList.contains('desktop-icons') || (target.parentElement === desktop && !target.closest('.desktop-icon, .window, #taskbar, #start-menu'))); if (isDesktopBlank) { mouseLongPressTimer = setTimeout(() => { mouseLongPressTriggered = true; showDesktopContextMenu(e.clientX, e.clientY); e.preventDefault(); }, LONG_PRESS_DELAY); } else { const actionable = target.closest('.desktop-icon, .file-open, .explorer-item, .window-header, #start-menu .menu-item, .task-item'); if (!actionable) return; mouseLongPressTimer = setTimeout(() => { mouseLongPressTriggered = true; showContextMenu(actionable, e.clientX, e.clientY); e.preventDefault(); }, LONG_PRESS_DELAY); } } function onMouseMove(e) { if (!mouseLongPressTimer) return; const dx = Math.abs(e.clientX - mouseStartX); const dy = Math.abs(e.clientY - mouseStartY); if (dx > MOVE_THRESHOLD || dy > MOVE_THRESHOLD) { clearMouseLongPress(); } } function onMouseUp(e) { clearMouseLongPress(); } function clearMouseLongPress() { if (mouseLongPressTimer) { clearTimeout(mouseLongPressTimer); mouseLongPressTimer = null; } } document.addEventListener('click', (e) => { if (longPressTriggered || mouseLongPressTriggered) { e.stopPropagation(); e.preventDefault(); longPressTriggered = false; mouseLongPressTriggered = false; } }, true); function getAppMenuItems(iframe) { if (!window._appContextMenus) return []; for (let [appId, data] of window._appContextMenus.entries()) { if (data.iframe === iframe) return data.items || []; } return []; } function showDesktopContextMenu(x, y) { const existingMenu = document.querySelector('.context-menu'); if (existingMenu) existingMenu.remove(); const desktopMenuItems = [ { label: '刷新', action: () => { syncDesktopShortcuts(); } }, // 改为调用同步函数 { label: '粘贴', action: () => pasteToDesktop() }, { label: '新建文件夹', action: () => createFolderOnDesktop() }, { label: '新建文本文档', action: () => newTextFile() }, { label: '更改壁纸', action: () => uploadWallpaper() }, { label: '排列图标', action: () => sortDesktopIcons() }, { label: '属性', action: () => showDesktopProperties() } ]; createContextMenu(desktopMenuItems, x, y); } function createContextMenu(items, x, y) { const menuDiv = document.createElement('div'); menuDiv.className = 'context-menu'; menuDiv.style.left = x + 'px'; menuDiv.style.top = y + 'px'; items.forEach(item => { const btn = document.createElement('div'); btn.className = 'context-menu-item'; btn.textContent = item.label; btn.addEventListener('click', (e) => { e.stopPropagation(); item.action(); menuDiv.remove(); }); menuDiv.appendChild(btn); }); document.body.appendChild(menuDiv); const rect = menuDiv.getBoundingClientRect(); if (rect.right > window.innerWidth) menuDiv.style.left = (window.innerWidth - rect.width - 10) + 'px'; if (rect.bottom > window.innerHeight) menuDiv.style.top = (window.innerHeight - rect.height - 10) + 'px'; const closeHandler = (e) => { if (!menuDiv.contains(e.target)) { menuDiv.remove(); document.removeEventListener('click', closeHandler); document.removeEventListener('touchstart', closeHandler); } }; setTimeout(() => { document.addEventListener('click', closeHandler); document.addEventListener('touchstart', closeHandler); }, 0); } async function pasteToDesktop() { if (!currentUserRoot) { alert("未登录"); return; } if (!clipboard.data) { alert('剪贴板为空'); return; } // 优先粘贴到桌面文件夹,不存在则回退到Documents const desktopFolder = getFolderByPath(currentUserRoot + '/Desktop'); const targetFolder = desktopFolder || getFolderByPath(currentUserRoot + '/Documents'); if (!targetFolder) { alert("无法找到目标文件夹"); return; } const srcFile = clipboard.data; if (targetFolder.children.some(f => f.name === srcFile.name)) { alert('目标文件夹中已存在同名文件'); return; } const newFile = JSON.parse(JSON.stringify(srcFile)); if (newFile.dbKey) { const blob = await getFileFromDB(srcFile.dbKey); if (blob) { const newDbKey = Date.now() + '_' + Math.random(); await saveFileToDB(newDbKey, blob); newFile.dbKey = newDbKey; delete newFile.content; } } targetFolder.children.push(newFile); saveFileSystem(); // 如果粘贴到桌面文件夹,需要同步桌面快捷方式 if (desktopFolder) { syncDesktopShortcuts(); } if (clipboard.type === 'cut') { const srcParent = getParentFolder(srcFile); if (srcParent) { const idx = srcParent.children.findIndex(f => f === srcFile); if (idx !== -1) { if (srcFile.dbKey) await deleteFileFromDB(srcFile.dbKey); srcParent.children.splice(idx, 1); saveFileSystem(); } } clipboard = { type: null, data: null }; } alert(`已粘贴到"${targetFolder.name}"`); renderDesktopIcons(); } function createFolderOnDesktop() { if (!currentUserRoot) { alert("未登录"); return; } const name = prompt('文件夹名称:', '新建文件夹'); if (name) { const myDocs = getFolderByPath(currentUserRoot + '/Documents'); if (myDocs && !myDocs.children.find(c => c.name === name)) { myDocs.children.push({ name, type: 'folder', children: [] }); saveFileSystem(); alert(`文件夹“${name}”已创建在“我的文档”中`); if (confirm('是否在桌面创建快捷方式?')) { const absolutePath = currentUserRoot ? currentUserRoot + '/Documents/' + name : 'Documents/' + name; desktopShortcuts.push({ id: generateShortcutId(), name: name, emoji: '📁', fullPath: absolutePath, isFolder: true, isWeb: false }); saveShortcuts(); renderDesktopIcons(); } } else alert('创建失败,可能同名'); } } function sortDesktopIcons() { builtinApps.sort((a,b) => a.name.localeCompare(b.name)); desktopShortcuts.sort((a,b) => a.name.localeCompare(b.name)); renderDesktopIcons(); alert('图标已按名称排序'); } function showDesktopProperties() { createWindow('显示属性', `
`;
document.body.appendChild(welcomeDiv);
// 尝试自动播放(部分浏览器会拦截 autoplay)
const oobeAudio = welcomeDiv.querySelector('#oobe-audio');
if (oobeAudio) oobeAudio.play().catch(() => {});
// 点击画面可跳过 GIF
welcomeDiv.addEventListener('click', function handler() {
welcomeDiv.removeEventListener('click', handler);
finishIntro();
});
// 【核心修复】5 秒后自动强制跳转
setTimeout(() => {
if (document.body.contains(welcomeDiv)) {
finishIntro();
}
}, 5500);
}
// 结束 GIF 播放 (修复:确保背景音乐持续播放)
function finishIntro() {
const div = document.getElementById('oobe-welcome');
if (div) {
// 【核心修复】把音频从容器中"解救"出来,挂载到页面,防止被销毁
const audio = div.querySelector('#oobe-audio');
if (audio) {
document.body.appendChild(audio);
audio.style.cssText = 'display: none; position: absolute;'; // 隐藏音频界面,让它默默播放
window._oobeAudio = audio; // 全局存储,供后续关闭
}
div.remove();
}
showOOBEStep1();
}
// ====== 第1步:欢迎使用 (修复:垂直居中) ======
function showOOBEStep1() {
oobeStep = 1;
const overlay = document.createElement('div');
overlay.id = 'oobe-container';
overlay.style.cssText = `
position: fixed; inset: 0; z-index: 999999;
background: url('imgs/login-bg.jpeg') center/cover no-repeat;
display: flex; flex-direction: column; justify-content: center; align-items: center;
`;
overlay.innerHTML = `
感谢您购买 Microsoft Windows XP。
让我们花几分钟来设置您的计算机。
联机与 Hmail 注册,我们会通知您感兴趣的新产品、产品更新、事件、促销和特别赠品。由您自己决定是否要注册。
准备好与 Hmail 联机注册了吗?
Hmail 承诺保护个人隐私,不会泄露您的信息。
请输入将使用此计算机的每位用户的名字。
祝贺您!您现在可以使用了!这是您刚刚完成的:
您的计算机已进行 Internet 访问配置。
要了解 Windows XP 激动人心的新功能,请使用产品漫游。您也可以在帮助和支持中心找到有用的信息。