/
githubmirror
/
PowerToys
Обзор
Документация
Войти
/
githubmirror
/
PowerToys
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/modules/FileLocksmith/FileLocksmithExt/RuntimeRegistration.h
36 строк
1 KB
leileizhang
refactor: Replace WiX-based registration with conditional runtime registration for Win10 context menu modules (#41275)
21 авг 2025, 13:10
Не верифицирован
21 авг 2025, 13:10
8cb2e4e
Код
Авторство
О чём код?
// Header-only runtime registration for FileLocksmith context menu extension. #pragma once #include <common/utils/shell_ext_registration.h> namespace globals { extern HMODULE instance; } namespace FileLocksmithRuntimeRegistration { namespace { inline runtime_shell_ext::Spec BuildSpec() { runtime_shell_ext::Spec spec; spec.clsid = L"{84D68575-E186-46AD-B0CB-BAEB45EE29C0}"; spec.sentinelKey = L"Software\\Microsoft\\PowerToys\\FileLocksmith"; spec.sentinelValue = L"ContextMenuRegistered"; spec.dllFileCandidates = { L"PowerToys.FileLocksmithExt.dll" }; spec.contextMenuHandlerKeyPaths = { L"Software\\Classes\\AllFileSystemObjects\\ShellEx\\ContextMenuHandlers\\FileLocksmithExt", L"Software\\Classes\\Drive\\ShellEx\\ContextMenuHandlers\\FileLocksmithExt" }; spec.friendlyName = L"File Locksmith Shell Extension"; return spec; } } inline bool EnsureRegistered() { return runtime_shell_ext::EnsureRegistered(BuildSpec(), globals::instance); } inline void Unregister() { runtime_shell_ext::Unregister(BuildSpec()); } }