INNER CODE UNIT · TypeScript
installWindowsTrayRecovery
hoowhoami/EchoMusic · src/main/app.ts:73
const installWindowsTrayRecovery = () => {
if (process.platform !== 'win32') return;
const mainWindow = getMainWindow();
if (!mainWindow || mainWindow.isDestroyed()) return;
mainWindow.hookWindowMessage(WM_TASKBARCREATED, () => {
refreshTray();
refreshTaskbarProgress();
// Windows 资源管理器重启后需要重新设置 thumbar 按钮
try {
setupThumbarButtons(mainWindow);
} catch (err) {
log.error('[Main] Failed to re-init thumbar after taskbar created:', err);
}
try {
setupTaskbarThumbnail(mainWindow);
} catch (err) {
log.error('[Main] Failed to re-init taskbar thumbnail after taskbar created:', err);