Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple OptiKey instances don't group together on Win10 taskbar #911

Open
lsaranto opened this issue Nov 2, 2023 · 1 comment
Open

Comments

@lsaranto
Copy link

lsaranto commented Nov 2, 2023

I'm running two OptiKey instances and noticed that the OptiKey instances don't group together on the taskbar on Win10 like other apps do when they have multiple windows open.

Here's a part of a screenshot that maybe explains the issue better.
screenshot

This is a minor issue, but at the same time, I do use the first slots on the taskbar to push down the "important" apps so that it's easier for me to reach them with the mouse.

@kmcnaught
Copy link
Collaborator

@lsaranto thanks for the report, I can only assume that the different command line args are affecting the application ID and therefore the grouping behaviour.

Suggested fix according to Phind - this is a note to myself to try to implement a fix...

To control the taskbar grouping behavior, you can manually assign the same AUMID to all instances of your application. You can do this using the Application.SetUserModelId method in WPF. Here's an example:

Application.SetUserModelId(Application.ExecutablePath);

In this example, Application.ExecutablePath is the path of your application's executable file. By setting the user model ID to the executable path, you're ensuring that all instances of your application will have the same AUMID, regardless of their command line arguments.

Please note that the SetUserModelId method should be called before the application's main window is shown, so you should typically call it in your application's Startup event or Main method.

Also, be aware that SetUserModelId requires Windows 7 or later, and it won't have any effect on earlier versions of Windows Microsoft Docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants