From 633dedb1b996a26dd9b6926252c1ee5921abad1f Mon Sep 17 00:00:00 2001 From: Lyubomir Ternavskiy <127299159+LyubomirT@users.noreply.github.com> Date: Fri, 26 Jul 2024 20:42:52 +0300 Subject: [PATCH] Refactor code to set explicit app user model ID on Windows --- ui.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui.py b/ui.py index b378f79..4d40741 100644 --- a/ui.py +++ b/ui.py @@ -11,7 +11,7 @@ def setupUi(self, MainWindow): MainWindow.setMinimumSize(QtCore.QSize(600, 400)) MainWindow.setMaximumSize(QtCore.QSize(600, 400)) MainWindow.setWindowIcon(QtGui.QIcon("logo.png")) - if sys.platform == "win32": + if sys.platform == "win32" and hasattr(ctypes.windll, "shell32"): ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID("Chainsaw Human Typing") self.centralwidget = QtWidgets.QWidget(MainWindow) self.centralwidget.setObjectName("centralwidget")