Skip to content

Conversation

bsteubing
Copy link
Member

Checklist

If you have write access (otherwise a maintainer will do this for you):

  • Categorize the PR by setting a good title and adding one of the labels:
    bug, feature, ui, change, documentation, breaking, ci
    as they show up in the changelog.
  • Add a milestone to the PR (and related issues, if any) for the intended release.
  • Request a review from another developer.

@bsteubing bsteubing requested a review from mrvisscher October 2, 2025 19:42
@bsteubing bsteubing added the beta Issues related to the Activity Browser 3 Beta label Oct 2, 2025
@bsteubing
Copy link
Member Author

I got the code from this repo: https://gist.github.com/pradishb/ceef2664ad3c565e918a84d2ba1e9c7b

And here some ChatGPT explanation on this:

About your snippet:

import ctypes
ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID("company.app.1")

🔹 What it does

  • This calls a Windows Shell API function (SetCurrentProcessExplicitAppUserModelID) from shell32.dll using ctypes.
  • It assigns a custom AppUserModelID to your Python process.

🔹 Why this matters

On Windows 7 and later, the taskbar groups windows by AppUserModelID:

  • Normally, when you run a .py file, your app shares the same AppUserModelID as python.exe. That’s why the taskbar icon shows the default Python logo.
  • By setting your own AppUserModelID (like "company.app.1"), you make Windows treat your running app as a separate application.

That allows:

  • A custom taskbar icon (the one you set via QApplication.setWindowIcon() in Qt).
  • Separate taskbar grouping (your app won’t be lumped under Python anymore).
  • Pinning your app to the taskbar as if it were a standalone program.

🔹 In short

That one line of code tells Windows:
“Don’t treat me as python.exe — I’m my own application with my own identity.”

And that’s why you need it when running from source: without it, Windows will always use Python’s icon in the taskbar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beta Issues related to the Activity Browser 3 Beta
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant