Created
June 27, 2012 11:19
-
-
Save m1el/3003442 to your computer and use it in GitHub Desktop.
JScript madness
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[{ | |
"type": 0, | |
"hmenu": 66707, | |
"id": 121, | |
"submenu": [{ | |
"type": 256, | |
"hmenu": 66709, | |
"id": 122, | |
"submenu": 0, | |
"text": "&Изменить атрибуты..." | |
}, { | |
"type": 256, | |
"hmenu": 66709, | |
"id": 123, | |
"submenu": 0, | |
"text": "&Упаковать...\tAlt+F5" | |
}, { | |
"type": 256, | |
"hmenu": 66709, | |
"id": 124, | |
"submenu": 0, | |
"text": "&Распаковать...\tAlt+F9" | |
}, { | |
"type": 256, | |
"hmenu": 66709, | |
"id": 125, | |
"submenu": 0, | |
"text": "Протестировать &архив(ы)\tAlt+Shift+F9" | |
}, { | |
"type": 256, | |
"hmenu": 66709, | |
"id": 126, | |
"submenu": 0, | |
"text": "Сравнить &по содержимому..." | |
}, { | |
"type": 256, | |
"hmenu": 66709, | |
"id": 127, | |
"submenu": 0, | |
"text": "&Открыть с помощью..." | |
}, { | |
"type": 256, | |
"hmenu": 66709, | |
"id": 128, | |
"submenu": 0, | |
"text": "В&нутренние ассоциации (только в TC)..." | |
}, { | |
"type": 256, | |
"hmenu": 66709, | |
"id": 129, | |
"submenu": 0, | |
"text": "Показать диалог сво&йств\tAlt+Enter" | |
}, { | |
"type": 256, | |
"hmenu": 66709, | |
"id": 130, | |
"submenu": 0, | |
"text": "Подсчитать занимаемое &место\tCtrl+L" | |
}, { | |
"type": 256, | |
"hmenu": 66709, | |
"id": 131, | |
"submenu": 0, | |
"text": "&Групповое переименование...\tCtrl+M" | |
}, { | |
"type": 256, | |
"hmenu": 66709, | |
"id": 132, | |
"submenu": 0, | |
"text": "&Комментарий к файлу...\tCtrl+Z" | |
}, { | |
"type": 256, | |
"hmenu": 66709, | |
"id": 133, | |
"submenu": [{ | |
"type": 256, | |
"hmenu": 66711, | |
"id": 134, | |
"submenu": 0, | |
"text": "&Список файлов..." | |
}, { | |
"type": 256, | |
"hmenu": 66711, | |
"id": 135, | |
"submenu": 0, | |
"text": "Список файлов с &подкаталогами..." | |
}, { | |
"type": 256, | |
"hmenu": 66711, | |
"id": 136, | |
"submenu": 0, | |
"text": "&Файл (содержимое)\tCtrl+F9" | |
}], | |
"text": "Пе&чать" | |
}, { | |
"type": 2048, | |
"hmenu": 66709, | |
"id": 137, | |
"submenu": 0, | |
"text": "" | |
}, { | |
"type": 256, | |
"hmenu": 66709, | |
"id": 138, | |
"submenu": 0, | |
"text": "Разби&ть файл..." | |
}, { | |
"type": 256, | |
"hmenu": 66709, | |
"id": 139, | |
"submenu": 0, | |
"text": "Со&брать файлы..." | |
}, { | |
"type": 256, | |
"hmenu": 66709, | |
"id": 140, | |
"submenu": 0, | |
"text": "Кодироват&ь (MIME, UUE, XXE)..." | |
}, { | |
"type": 256, | |
"hmenu": 66709, | |
"id": 141, | |
"submenu": 0, | |
"text": "&Декодировать (MIME, UUE, XXE, BinHex)..." | |
}, { | |
"type": 256, | |
"hmenu": 66709, | |
"id": 142, | |
"submenu": 0, | |
"text": "По&считать CRC-суммы (CRC32, MD5, SHA1)..." | |
}, { | |
"type": 256, | |
"hmenu": 66709, | |
"id": 143, | |
"submenu": 0, | |
"text": "Про&верить CRC-суммы (CRC32, MD5, SHA1)" | |
}, { | |
"type": 2048, | |
"hmenu": 66709, | |
"id": 144, | |
"submenu": 0, | |
"text": "" | |
}, { | |
"type": 256, | |
"hmenu": 66709, | |
"id": 145, | |
"submenu": 0, | |
"text": "В&ыход\tAlt+F4" | |
}], | |
"text": "&Файлы" | |
}, { | |
"type": 0, | |
"hmenu": 66707, | |
"id": 146, | |
"submenu": [{ | |
"type": 256, | |
"hmenu": 66713, | |
"id": 147, | |
"submenu": 0, | |
"text": "Выде&лить группу...\tNum +" | |
}, { | |
"type": 256, | |
"hmenu": 66713, | |
"id": 148, | |
"submenu": 0, | |
"text": "Снять выделение &группы...\tNum -" | |
}, { | |
"type": 256, | |
"hmenu": 66713, | |
"id": 149, | |
"submenu": 0, | |
"text": "Вы&делить всё\tCtrl+Num +" | |
}, { | |
"type": 256, | |
"hmenu": 66713, | |
"id": 150, | |
"submenu": 0, | |
"text": "Сн&ять всё выделение\tCtrl+Num -" | |
}, { | |
"type": 256, | |
"hmenu": 66713, | |
"id": 151, | |
"submenu": 0, | |
"text": "&Инвертировать выделение\tNum *" | |
}, { | |
"type": 256, | |
"hmenu": 66713, | |
"id": 152, | |
"submenu": 0, | |
"text": "Выделить файлы/папки по &расширению\tAlt+Num +" | |
}, { | |
"type": 2048, | |
"hmenu": 66713, | |
"id": 153, | |
"submenu": 0, | |
"text": "" | |
}, { | |
"type": 256, | |
"hmenu": 66713, | |
"id": 154, | |
"submenu": 0, | |
"text": "С&охранить выделение" | |
}, { | |
"type": 256, | |
"hmenu": 66713, | |
"id": 155, | |
"submenu": 0, | |
"text": "Восс&тановить выделение\tNum /" | |
}, { | |
"type": 256, | |
"hmenu": 66713, | |
"id": 156, | |
"submenu": 0, | |
"text": "Со&хранить выделение в файл..." | |
}, { | |
"type": 256, | |
"hmenu": 66713, | |
"id": 157, | |
"submenu": 0, | |
"text": "Загрузить выделение из &файла..." | |
}, { | |
"type": 2048, | |
"hmenu": 66713, | |
"id": 158, | |
"submenu": 0, | |
"text": "" | |
}, { | |
"type": 256, | |
"hmenu": 66713, | |
"id": 159, | |
"submenu": 0, | |
"text": "Копировать имена файлов в &буфер" | |
}, { | |
"type": 256, | |
"hmenu": 66713, | |
"id": 160, | |
"submenu": 0, | |
"text": "Копировать полн&ые имена файлов" | |
}, { | |
"type": 256, | |
"hmenu": 66713, | |
"id": 161, | |
"submenu": 0, | |
"text": "Копировать &содержимое всех колонок" | |
}, { | |
"type": 256, | |
"hmenu": 66713, | |
"id": 162, | |
"submenu": 0, | |
"text": "Копировать &все колонки (полные пути)" | |
}, { | |
"type": 2048, | |
"hmenu": 66713, | |
"id": 163, | |
"submenu": 0, | |
"text": "" | |
}, { | |
"type": 256, | |
"hmenu": 66713, | |
"id": 164, | |
"submenu": 0, | |
"text": "Сравнить &каталоги\tShift+F2" | |
}, { | |
"type": 256, | |
"hmenu": 66713, | |
"id": 165, | |
"submenu": 0, | |
"text": "Срав&нить, скрыв одинаковые файлы" | |
}], | |
"text": "&Выделение" | |
}, { | |
"type": 0, | |
"hmenu": 66707, | |
"id": 166, | |
"submenu": [{ | |
"type": 256, | |
"hmenu": 66715, | |
"id": 167, | |
"submenu": 0, | |
"text": "&Дерево каталогов...\tAlt+F10" | |
}, { | |
"type": 256, | |
"hmenu": 66715, | |
"id": 168, | |
"submenu": 0, | |
"text": "&Поиск файлов...\tAlt+F7" | |
}, { | |
"type": 256, | |
"hmenu": 66715, | |
"id": 169, | |
"submenu": 0, | |
"text": "&Метка диска..." | |
}, { | |
"type": 256, | |
"hmenu": 66715, | |
"id": 170, | |
"submenu": 0, | |
"text": "&Информация о системе" | |
}, { | |
"type": 256, | |
"hmenu": 66715, | |
"id": 171, | |
"submenu": 0, | |
"text": "&Синхронизировать каталоги..." | |
}, { | |
"type": 256, | |
"hmenu": 66715, | |
"id": 172, | |
"submenu": 0, | |
"text": "Из&бранные каталоги\tCtrl+D" | |
}, { | |
"type": 256, | |
"hmenu": 66715, | |
"id": 173, | |
"submenu": 0, | |
"text": "&Назад\tAlt+ <-" | |
}, { | |
"type": 2048, | |
"hmenu": 66715, | |
"id": 174, | |
"submenu": 0, | |
"text": "" | |
}, { | |
"type": 256, | |
"hmenu": 66715, | |
"id": 175, | |
"submenu": 0, | |
"text": "Открыть командную &консоль" | |
}, { | |
"type": 2048, | |
"hmenu": 66715, | |
"id": 176, | |
"submenu": 0, | |
"text": "" | |
}, { | |
"type": 256, | |
"hmenu": 66715, | |
"id": 177, | |
"submenu": 0, | |
"text": "Показать все фа&йлы без подкаталогов\tCtrl+B" | |
}, { | |
"type": 256, | |
"hmenu": 66715, | |
"id": 178, | |
"submenu": 0, | |
"text": "Открыть папку <&Рабочий стол>" | |
}, { | |
"type": 256, | |
"hmenu": 66715, | |
"id": 179, | |
"submenu": 0, | |
"text": "Диспетчер &фоновой пересылки..." | |
}, { | |
"type": 2048, | |
"hmenu": 66715, | |
"id": 180, | |
"submenu": 0, | |
"text": "" | |
}, { | |
"type": 256, | |
"hmenu": 66715, | |
"id": 181, | |
"submenu": 0, | |
"text": "Поменять местами панели (ак&тивные вкладки)\tCtrl+U" | |
}, { | |
"type": 256, | |
"hmenu": 66715, | |
"id": 182, | |
"submenu": 0, | |
"text": "Получатель &= Источнику" | |
}], | |
"text": "К&оманды" | |
}, { | |
"type": 0, | |
"hmenu": 66707, | |
"id": 183, | |
"submenu": [{ | |
"type": 256, | |
"hmenu": 66717, | |
"id": 184, | |
"submenu": 0, | |
"text": "Под&ключить сетевой диск..." | |
}, { | |
"type": 256, | |
"hmenu": 66717, | |
"id": 185, | |
"submenu": 0, | |
"text": "&Отключить сетевой диск..." | |
}, { | |
"type": 256, | |
"hmenu": 66717, | |
"id": 186, | |
"submenu": 0, | |
"text": "Открыть о&бщий доступ к каталогу..." | |
}, { | |
"type": 256, | |
"hmenu": 66717, | |
"id": 187, | |
"submenu": 0, | |
"text": "&Закрыть общий доступ к каталогу..." | |
}, { | |
"type": 256, | |
"hmenu": 66717, | |
"id": 188, | |
"submenu": 0, | |
"text": "Показать ресурсы а&дминистратора" | |
}, { | |
"type": 2048, | |
"hmenu": 66717, | |
"id": 189, | |
"submenu": 0, | |
"text": "" | |
}, { | |
"type": 256, | |
"hmenu": 66717, | |
"id": 190, | |
"submenu": 0, | |
"text": "&Соединиться с FTP-сервером...\tCtrl+F" | |
}, { | |
"type": 256, | |
"hmenu": 66717, | |
"id": 191, | |
"submenu": 0, | |
"text": "&Новое FTP-соединение...\tCtrl+N" | |
}, { | |
"type": 256, | |
"hmenu": 66717, | |
"id": 192, | |
"submenu": 0, | |
"text": "&Разорвать FTP-соединение\tCtrl+Shift+F" | |
}, { | |
"type": 256, | |
"hmenu": 66717, | |
"id": 193, | |
"submenu": 0, | |
"text": "Показывать скрытые &файлы на сервере" | |
}, { | |
"type": 256, | |
"hmenu": 66717, | |
"id": 194, | |
"submenu": 0, | |
"text": "Загрузка &по списку..." | |
}, { | |
"type": 256, | |
"hmenu": 66717, | |
"id": 195, | |
"submenu": 0, | |
"text": "&Установить соединение через LPT/USB-порт..." | |
}], | |
"text": "&Сеть" | |
}, { | |
"type": 0, | |
"hmenu": 66707, | |
"id": 196, | |
"submenu": [{ | |
"type": 768, | |
"hmenu": 66719, | |
"id": 197, | |
"submenu": 0, | |
"text": "&Краткий\tCtrl+F1" | |
}, { | |
"type": 768, | |
"hmenu": 66719, | |
"id": 198, | |
"submenu": 0, | |
"text": "&Подробный\tCtrl+F2" | |
}, { | |
"type": 768, | |
"hmenu": 66719, | |
"id": 199, | |
"submenu": 0, | |
"text": "Коммента&рии\tCtrl+Shift+F2" | |
}, { | |
"type": 768, | |
"hmenu": 66719, | |
"id": 200, | |
"submenu": [{ | |
"type": 768, | |
"hmenu": 66727, | |
"id": 240, | |
"submenu": 0, | |
"text": "1 default" | |
}, { | |
"type": 2048, | |
"hmenu": 66727, | |
"id": 241, | |
"submenu": 0, | |
"text": "" | |
}, { | |
"type": 256, | |
"hmenu": 66727, | |
"id": 242, | |
"submenu": 0, | |
"text": "Настроить &наборы колонок..." | |
}], | |
"text": "По&льзовательский набор колонок\tShift+F1" | |
}, { | |
"type": 768, | |
"hmenu": 66719, | |
"id": 201, | |
"submenu": 0, | |
"text": "&Дерево каталогов\tCtrl+F8" | |
}, { | |
"type": 256, | |
"hmenu": 66719, | |
"id": 202, | |
"submenu": [{ | |
"type": 768, | |
"hmenu": 66721, | |
"id": 203, | |
"submenu": 0, | |
"text": "&0 (Нет)" | |
}, { | |
"type": 768, | |
"hmenu": 66721, | |
"id": 204, | |
"submenu": 0, | |
"text": "&1 (Одно для обеих панелей)" | |
}, { | |
"type": 768, | |
"hmenu": 66721, | |
"id": 205, | |
"submenu": 0, | |
"text": "&2 (Два, по одному на панель)" | |
}], | |
"text": "Дерево в отдельной панели\tCtrl+Shift+F8" | |
}, { | |
"type": 768, | |
"hmenu": 66719, | |
"id": 206, | |
"submenu": 0, | |
"text": "Просмотр &эскизов\tCtrl+Shift+F1" | |
}, { | |
"type": 256, | |
"hmenu": 66719, | |
"id": 207, | |
"submenu": 0, | |
"text": "&Быстрый просмотр\tCtrl+Q" | |
}, { | |
"type": 256, | |
"hmenu": 66719, | |
"id": 208, | |
"submenu": 0, | |
"text": "П&анели одна над другой" | |
}, { | |
"type": 256, | |
"hmenu": 66719, | |
"id": 209, | |
"submenu": 0, | |
"text": "&Новая вкладка для текущей папки\tCtrl+T" | |
}, { | |
"type": 2048, | |
"hmenu": 66719, | |
"id": 210, | |
"submenu": 0, | |
"text": "" | |
}, { | |
"type": 768, | |
"hmenu": 66719, | |
"id": 211, | |
"submenu": 0, | |
"text": "Вс&е файлы\tCtrl+F10" | |
}, { | |
"type": 768, | |
"hmenu": 66719, | |
"id": 212, | |
"submenu": 0, | |
"text": "Програ&ммы\tCtrl+F11" | |
}, { | |
"type": 768, | |
"hmenu": 66719, | |
"id": 213, | |
"submenu": 0, | |
"text": "*.*" | |
}, { | |
"type": 768, | |
"hmenu": 66719, | |
"id": 214, | |
"submenu": 0, | |
"text": "&Фильтр...\tCtrl+F12" | |
}, { | |
"type": 256, | |
"hmenu": 66719, | |
"id": 215, | |
"submenu": 0, | |
"text": "Показать только выделенные об&ъекты" | |
}, { | |
"type": 2048, | |
"hmenu": 66719, | |
"id": 216, | |
"submenu": 0, | |
"text": "" | |
}, { | |
"type": 768, | |
"hmenu": 66719, | |
"id": 217, | |
"submenu": 0, | |
"text": "По &имени\tCtrl+F3" | |
}, { | |
"type": 768, | |
"hmenu": 66719, | |
"id": 218, | |
"submenu": 0, | |
"text": "По &типу\tCtrl+F4" | |
}, { | |
"type": 768, | |
"hmenu": 66719, | |
"id": 219, | |
"submenu": 0, | |
"text": "По дате/&времени\tCtrl+F5" | |
}, { | |
"type": 768, | |
"hmenu": 66719, | |
"id": 220, | |
"submenu": 0, | |
"text": "По ра&змеру\tCtrl+F6" | |
}, { | |
"type": 768, | |
"hmenu": 66719, | |
"id": 221, | |
"submenu": 0, | |
"text": "Без &сортировки\tCtrl+F7" | |
}, { | |
"type": 2048, | |
"hmenu": 66719, | |
"id": 222, | |
"submenu": 0, | |
"text": "" | |
}, { | |
"type": 256, | |
"hmenu": 66719, | |
"id": 223, | |
"submenu": 0, | |
"text": "В &обратном порядке" | |
}, { | |
"type": 2048, | |
"hmenu": 66719, | |
"id": 224, | |
"submenu": 0, | |
"text": "" | |
}, { | |
"type": 256, | |
"hmenu": 66719, | |
"id": 225, | |
"submenu": 0, | |
"text": "Обновить содер&жимое панели\tCtrl+R" | |
}], | |
"text": "Ви&д" | |
}, { | |
"type": 0, | |
"hmenu": 66707, | |
"id": 226, | |
"submenu": [{ | |
"type": 256, | |
"hmenu": 66723, | |
"id": 227, | |
"submenu": 0, | |
"text": "&Настройка..." | |
}, { | |
"type": 256, | |
"hmenu": 66723, | |
"id": 228, | |
"submenu": 0, | |
"text": "Панель &инструментов..." | |
}, { | |
"type": 256, | |
"hmenu": 66723, | |
"id": 229, | |
"submenu": 0, | |
"text": "&Редактировать файлы конфигурации" | |
}, { | |
"type": 256, | |
"hmenu": 66723, | |
"id": 230, | |
"submenu": 0, | |
"text": "Сохранить &позицию" | |
}, { | |
"type": 256, | |
"hmenu": 66723, | |
"id": 231, | |
"submenu": 0, | |
"text": "Со&хранить настройки" | |
}], | |
"text": "&Конфигурация" | |
}, { | |
"type": 0, | |
"hmenu": 66707, | |
"id": 232, | |
"submenu": [{ | |
"type": 256, | |
"hmenu": 66753, | |
"id": 243, | |
"submenu": 0, | |
"text": "Изменить меню <&Запуск>..." | |
}, { | |
"type": 256, | |
"hmenu": 66753, | |
"id": 244, | |
"submenu": 0, | |
"text": "Изменить &главное меню..." | |
}], | |
"text": "&Запуск" | |
}, { | |
"type": 16384, | |
"hmenu": 66707, | |
"id": 233, | |
"submenu": [{ | |
"type": 256, | |
"hmenu": 66725, | |
"id": 234, | |
"submenu": 0, | |
"text": "&Содержание\tF1" | |
}, { | |
"type": 256, | |
"hmenu": 66725, | |
"id": 235, | |
"submenu": 0, | |
"text": "&Горячие клавиши" | |
}, { | |
"type": 256, | |
"hmenu": 66725, | |
"id": 236, | |
"submenu": 0, | |
"text": "О &регистрации" | |
}, { | |
"type": 256, | |
"hmenu": 66725, | |
"id": 237, | |
"submenu": 0, | |
"text": "&Посетить сайт программы" | |
}, { | |
"type": 2048, | |
"hmenu": 66725, | |
"id": 238, | |
"submenu": 0, | |
"text": "" | |
}, { | |
"type": 256, | |
"hmenu": 66725, | |
"id": 239, | |
"submenu": 0, | |
"text": "&О Total Commander..." | |
}], | |
"text": "Сп&равка" | |
}] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var DX = new ActiveXObject("DynamicWrapperX"); | |
DX.Register("user32", "EnumWindows", "i=pl"); | |
DX.Register("user32", "EnumChildWindows", "i=hpl", "r=b"); | |
DX.Register("user32", "GetWindowTextW", "i=hWl", "r=l"); | |
DX.Register("user32", "GetClassNameW", "i=hWl", "r=l"); | |
DX.Register("user32", "GetMenu", "i=h", "r=h"); | |
DX.Register("user32", "GetMenuInfo", "i=hp"); | |
DX.Register("user32", "GetMenuItemCount", "i=h", "r=h"); | |
DX.Register("user32", "GetMenuItemID", "i=h", "r=l"); | |
DX.Register("user32", "GetMenuItemInfoW", "i=huup", "r=u"); | |
DX.Register("user32", "GetMenuStringW", "i=hupuu", "r=u"); | |
function echo(x){ | |
WScript.Echo(x); | |
} | |
var JSON;if(!JSON){JSON={};}(function(){'use strict';function f(n){return n<10?'0'+n:n;}if(typeof Date.prototype.toJSON!=='function'){Date.prototype.toJSON=function(key){return isFinite(this.valueOf())?this.getUTCFullYear()+'-'+f(this.getUTCMonth()+1)+'-'+f(this.getUTCDate())+'T'+f(this.getUTCHours())+':'+f(this.getUTCMinutes())+':'+f(this.getUTCSeconds())+'Z':null;};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(key){return this.valueOf();};}var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'},rep;function quote(string){escapable.lastIndex=0;return escapable.test(string)?'"'+string.replace(escapable,function(a){var c=meta[a];return typeof c==='string'?c:'\\u'+('0000'+a.charCodeAt(0).toString(16)).slice(-4);})+'"':'"'+string+'"';}function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key];if(value&&typeof value==='object'&&typeof value.toJSON==='function'){value=value.toJSON(key);}if(typeof rep==='function'){value=rep.call(holder,key,value);}switch(typeof value){case'string':return quote(value);case'number':return isFinite(value)?String(value):'null';case'boolean':case'null':return String(value);case'object':if(!value){return'null';}gap+=indent;partial=[];if(Object.prototype.toString.apply(value)==='[object Array]'){length=value.length;for(i=0;i<length;i+=1){partial[i]=str(i,value)||'null';}v=partial.length===0?'[]':gap?'[\n'+gap+partial.join(',\n'+gap)+'\n'+mind+']':'['+partial.join(',')+']';gap=mind;return v;}if(rep&&typeof rep==='object'){length=rep.length;for(i=0;i<length;i+=1){k=rep[i];if(typeof k==='string'){v=str(k,value);if(v){partial.push(quote(k)+(gap?': ':':')+v);}}}}else{for(k in value){if(Object.prototype.hasOwnProperty.call(value,k)){v=str(k,value);if(v){partial.push(quote(k)+(gap?': ':':')+v);}}}}v=partial.length===0?'{}':gap?'{\n'+gap+partial.join(',\n'+gap)+'\n'+mind+'}':'{'+partial.join(',')+'}';gap=mind;return v;}}if(typeof JSON.stringify!=='function'){JSON.stringify=function(value,replacer,space){var i;gap='';indent='';if(typeof space==='number'){for(i=0;i<space;i+=1){indent+=' ';}}else if(typeof space==='string'){indent=space;}rep=replacer;if(replacer&&typeof replacer!=='function'&&(typeof replacer!=='object'||typeof replacer.length!=='number')){throw new Error('JSON.stringify');}return str('',{'':value});};}if(typeof JSON.parse!=='function'){JSON.parse=function(text,reviver){var j;function walk(holder,key){var k,v,value=holder[key];if(value&&typeof value==='object'){for(k in value){if(Object.prototype.hasOwnProperty.call(value,k)){v=walk(value,k);if(v!==undefined){value[k]=v;}else{delete value[k];}}}}return reviver.call(holder,key,value);}text=String(text);cx.lastIndex=0;if(cx.test(text)){text=text.replace(cx,function(a){return'\\u'+('0000'+a.charCodeAt(0).toString(16)).slice(-4);});}if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,'@').replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,']').replace(/(?:^|:|,)(?:\s*\[)+/g,''))){j=eval('('+text+')');return typeof reviver==='function'?walk({'':j},''):j;}throw new SyntaxError('JSON.parse');};}if(!Object.prototype.toJSONString){Object.prototype.toJSONString=function(filter){return JSON.stringify(this,filter);};Object.prototype.parseJSON=function(filter){return JSON.parse(this,filter);};}}()); | |
var w32 = {} | |
w32.bufsize = 1e4; | |
w32.buffer = DX.Space(w32.bufsize); | |
w32.get_win_title = function(hwnd) { | |
DX.GetWindowTextW(hwnd, w32.buffer, w32.bufsize); | |
return w32.buffer.substring(0); | |
}; | |
w32.get_win_class = function(hwnd){ | |
DX.GetClassNameW(hwnd, w32.buffer, w32.bufsize); | |
return w32.buffer.substring(0); | |
}; | |
w32.get_windows = (function (){ | |
var n=0; | |
var | |
regex, cregex, | |
pCbkFunc = DX.RegisterCallback(CbkEnumWin, "i=hl", "r=l"), | |
WinList; | |
function CbkEnumWin(hwnd, lparam) { | |
var title = w32.get_win_title(hwnd), clss = w32.get_win_class(hwnd); | |
if (regex.test(title) && cregex.test(clss)) { | |
WinList[n] = {hwnd:hwnd, title:title, clss:clss}; | |
n++; | |
} | |
return 1; | |
} | |
return function (root, regex_, cregex_) { | |
regex = new RegExp(regex_ === 0 || typeof regex_ == "undefined" ? "" : regex_); | |
cregex = new RegExp(typeof cregex_ == "undefined" ? "" : cregex_); | |
WinList = []; | |
n = 0; | |
DX.EnumChildWindows(root, pCbkFunc, 0); | |
return WinList; | |
} | |
})(); | |
w32.get_menu = function(hwnd, hmenu) { | |
var hmenu = hmenu ? hwnd : DX.GetMenu(hwnd), | |
count = DX.GetMenuItemCount(hmenu); | |
var menu = []; | |
for(var i = 0; i < count; i++){ | |
pmii = DX.Space(4*12, "\x00"); | |
DX.NumPut(4*12, pmii, 0*4); | |
DX.NumPut(0x02|0x40|0x04|0x100, pmii, 1*4); //MIIM_ID|MIIM_STRING|MIIM_SUBMENU|MIIM_TYPE | |
DX.GetMenuItemInfoW(hmenu, i, 1, pmii); | |
var len = DX.NumGet(pmii, 10*4), | |
str = DX.StrPtr(DX.Space(2*(len+1), "\x00")); | |
DX.NumPut(str, pmii, 9*4, "p"); | |
DX.NumPut(len+1, pmii, 10*4, "u"), | |
DX.GetMenuItemInfoW(hmenu, i, 1, pmii); | |
submenu = DX.NumGet(pmii, 5*4, "u"); | |
menu[i] = { | |
type: DX.NumGet(pmii, 2*4, "u"), | |
hmenu: hmenu, | |
id: DX.NumGet(pmii, 4*4, "u"), | |
submenu: submenu, | |
text: DX.StrGet(str, "w").substring(0) | |
} | |
if(submenu){ | |
menu[i].submenu = w32.get_menu(submenu, 1); | |
} | |
} | |
return menu; | |
}; | |
var | |
l0 = w32.get_windows(0, /Total/); | |
echo(JSON.stringify(w32.get_menu(l0[0].hwnd))); | |
//recursive_window_read(l0); | |
function recursive_window_read(l,e){ | |
if(e === undefined) e = ""; | |
for(var i = 0; i < l.length; i++) { | |
echo(e + l[i].hwnd + ":" + l[i].title + ":" + l[i].clss); | |
rec_get(w32.get_windows(l[i].hwnd), e+"\t"); | |
} | |
} | |
// vim: set fenc=cp1251 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment