-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
37 lines (26 loc) · 867 Bytes
/
Copy pathmain.py
File metadata and controls
37 lines (26 loc) · 867 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import ctypes
from PySide6.QtWidgets import QApplication
import sys
from core.version import get_version
from ui.pages.home_page import HomePage
# img = Image.open("image.png")
if __name__ == '__main__':
print(f"LazyIconCreator {get_version()} has been launched.")
# img.save("icon.ico", sizes=[(256,256)])
# print("icon.ico saved")
# Creating app and registering in system
app = QApplication(sys.argv)
# Open new start window
window = HomePage()
window.show()
# Trying to set window icon
try:
appid = 'RED-IGLA.LazyIconCreator'
shell32 = ctypes.windll.shell32
set_id_func = getattr(shell32, 'SetCurrentProcessExplicitAppUserModelID', None)
if set_id_func:
set_id_func(appid)
except (OSError, AttributeError):
pass
# Endless cycle
sys.exit(app.exec())