mirror of
https://github.com/MCV-Software/TWBlue.git
synced 2025-08-05 13:36:08 -04:00
Putting all the code from the current master branch of TWBlue
This commit is contained in:
0
src/platform_utils/shell_integration/__init__.py
Normal file
0
src/platform_utils/shell_integration/__init__.py
Normal file
10
src/platform_utils/shell_integration/windows.py
Normal file
10
src/platform_utils/shell_integration/windows.py
Normal file
@@ -0,0 +1,10 @@
|
||||
import _winreg
|
||||
|
||||
SHELL_REGKEY = ur"Directory\shell"
|
||||
|
||||
def context_menu_integrate(item_key_name, item_display_text, item_command):
|
||||
app_menu_key = _winreg.OpenKey(_winreg.HKEY_CLASSES_ROOT, SHELL_REGKEY, 0, _winreg.KEY_WRITE)
|
||||
menu_item_key = _winreg.CreateKey(app_menu_key, item_key_name)
|
||||
_winreg.SetValueEx(menu_item_key, None, None, _winreg.REG_SZ, item_display_text)
|
||||
item_command_key = _winreg.CreateKey(menu_item_key, 'command')
|
||||
_winreg.SetValueEx(item_command_key, None, None, _winreg.REG_SZ, item_command)
|
Reference in New Issue
Block a user