block_taskmgr関数を呼び出してなかったので修正

This commit is contained in:
suti7yk5032 2024-06-08 09:46:24 +09:00
parent a52533f34b
commit 5b9395a1d2

View file

@ -18,7 +18,7 @@ class App(customtkinter.CTk):
self.restore_button = customtkinter.CTkButton(self.frame, text='認証ウィンドウを再表示', command=self.handler_close, width=240) self.restore_button = customtkinter.CTkButton(self.frame, text='認証ウィンドウを再表示', command=self.handler_close, width=240)
self.restore_button.grid(row=0, column=0) self.restore_button.grid(row=0, column=0)
self.block_taskmgr self.block_taskmgr()
self.block_key() self.block_key()
lock = Lock() lock = Lock()
@ -33,10 +33,12 @@ class App(customtkinter.CTk):
keyboard.block_key(i) keyboard.block_key(i)
def block_taskmgr(self): def block_taskmgr(self):
subprocess.run(['reg', 'add', 'HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System', '/v', 'DisableTaskMgr', '/t', 'REG_DWORD', '/d', '1']) block = subprocess.run(['reg', 'add', 'HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System', '/v', 'DisableTaskMgr', '/t', 'REG_DWORD', '/d', '1'])
print(block)
def unlock_taskmgr(self): def unlock_taskmgr(self):
subprocess.run(['reg', 'delete', 'HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System', '/v', 'DisableTaskMgr', '/f']) unlock = subprocess.run(['reg', 'delete', 'HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System', '/v', 'DisableTaskMgr', '/f'])
print(unlock)
def toast(self): def toast(self):
resource_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), "resource") resource_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), "resource")