Hey i am trying to make a application working in windows. It's basically adjusting your monitor brightness. There is a function provides minimize application. So i have issue about minimize.
When clicking second time to minimize button getting error:
Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\tkinter\__init__.py", line 1921, in __call__
return self.func(*args)
File "C:\Users\user\OneDrive\Desktop\Python_simple_projects\Desktop_brightness_app\test.py", line 249, in minimize_app
self.icon.run()
File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\pystray\_base.py", line 212, in run
self._run()
File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\pystray\_win32.py", line 120, in _run
self._hwnd = self._create_window(self._atom)
File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\pystray\_win32.py", line 244, in _create_window
hwnd = win32.CreateWindowEx(
File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\pystray\_util\win32.py", line 204, in _err
raise ctypes.WinError()
OSError: [WinError 6] The handle is invalid.
Hey i am trying to make a application working in windows. It's basically adjusting your monitor brightness. There is a function provides minimize application. So i have issue about minimize.
When clicking second time to minimize button getting error:
There is a few part of code below: