Question

I noticed for a few updates of Skype now that if you start 2 or 3 instances of Skype, in the windows taskbar they appear as separate windows and you can drag them individually as opposed to other applications when they are "glued" together and you can drag them all at once. My question is how can I implement the individual appearance in my application and is it possible from C# or through winapi?

Était-ce utile?

La solution

The shell groups windows in the taskbar using each window's Application User Model ID (AppUserModelID).

By default, every window generated by a given EXE (even in different processes) shares a system-generated AppUserModelID.

You can give each process its own AppUserModelID by calling SetCurrentProcessExplicitAppUserModelID. From your description this is probably what Skype is doing, though I haven't checked.

You can give each window its own AppUserModelID by setting a different PKEY_AppUserModel_ID property on the windows.

Note that these IDs are required to have a particular format:

CompanyName.ProductName.SubProduct.VersionInformation

Raymond Chen wrote an article about this, and it's also worth reading the documentation I linked to.

I'm not aware of WinForms having explicit support for this, but you could certainly use interop to call the Win32 API directly.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top