How to move a window from one group on taskbar to another? - winapi

I want to make a new group for windows in Windows XP taskbar. I would like to move windows from one group to another, how can I do this?
Here is image of one group which has 7 windows:
What I want to do is move out some windows into its own group.

What you are asking for is not officially supported in XP. The grouping is controlled by the OS based on the executable of each running process. Multiple instances of the same executable are grouped together. There is no option to change that behavior, only to enable/disable it in the Control Panel settings. If you want to manipulate groups, you have to do so manually using the Toolbar API and undocumented data structures, as outlined in this article: Manipulating Taskbar Buttons (use at your own risk).
The feature you are looking for is officially supported in Windows 7 and later by using Application User Model IDs instead. Windows that are assigned the same AppUserModelID are grouped together. Use SetCurrentProcessExplicitAppUserModelID() to set a process-wide AppUserModelID. If an app (like a legacy app) does not assign a process-wide AppUserModelID, the OS auto-generates one. The process AppUserModelID is used as the default when creating windows. A window-specific AppUserModelID can then be assigned using SHGetPropertyStoreForWindow() and IPropertyStore::SetValue() if needed. This allows a single process to have multiple taskbar groups, and multiple related processes to use a single shared taskbar group.

Related

Matching Delphi monitor indexes to Windows Desktop numbering [duplicate]

When you press Identify button in Screen Resolution dialog then Windows shows you big white monitor numbers on each monitor. It was easy to find them programmatically together with monitor coordinates in Windows XP (with EnumDisplayDevices) but on Windows 7 it's broken. How can I do that?
EnumDisplayDevices and GetMonitorInfo are not reliable anymore for that purpose in Windows 7.
I tried GetMonitorInfo and then extracting monitor number from MONITORINFOEX.szDevice (I.E. \.\Display2) with no success. Another guy did that too two years ago and claimed that getMonitorInfo has a bug. This bug was marked as fixed by Microsoft without any comments but it still can be reproduced on a win7 machine having latest updates. (Btw, can anybody tell me - maybe this bug is absent on win8 ?)
I tried QueryDisplayConfig from new CCD API but didn't find needed info.
Does anybody know the way?
Windows does not provide a function that allows applications to obtain the numbers used by the display settings app. The numbers themselves are specific only to the display settings app and have no meaning in the system or in the CCD APIs used to query/set the display topology.
The best option is for applications to define their own criteria for assigning an index when prompting the user to select a display.
I have never wanted to know in my Windows applications the number of monitors, but you can call GetSystemMetrics function with parameter value SM_CMONITORS to get the number of display monitors on a desktop.
I call in my Windows applications function GetSystemMetrics mainly with the parameter values SM_CXVIRTUALSCREEN, SM_CYVIRTUALSCREEN, SM_XVIRTUALSCREEN and SM_YVIRTUALSCREEN to avoid opening application windows completely or partly outside the display area. An application window could be nevertheless not visible if the user has extended the display area over multiple monitors, but not all of them are turned on.
The SystemParametersInfo function function with value SPI_GETWORKAREA for uiAction parameter is also very useful to know where an application window can be positioned and how large it can be in width and height on primary screen without being partly hidden by other windows (bars) being always on top.
See also GetMonitorInfo function if more informations from the monitors are required in your Windows application.
For Windows versions supporting WDDM, which Windows 7 does, you can simply use DXGI which is part of DirectX. DXGI allows you to very easily enumerate the existing display adapters, the available display outputs per adapter and the supported display modes per display output. While enumerating there's a lot of additional data you can read out, like handles, identifiers and device names. All of this can easily be used to retrieve the working areas as well. The order in which adapters and outputs are enumerated is defined by the system and matches the order of your configuration screen.
See here for more information: MSDN DXGI Overview

Show Window specific JumpList in Windows

My program opens multiple windows on taskbar (not MDI). I want to display a Jumplist that is specific for each Window. How is it done?
Windows uses the Application User Model ID to group taskbar buttons and jump lists. This lets you group multiple processes together, or in your case split multiple windows from the same process.
You can assign a different AppUserModelID to a window by using the SHGetPropertyStoreForWindow() function to obtain the window's IPropertyStore interface and then set its System.AppUserModel.ID property.

Grouping taskbar icons in Windows 7

Look at the screen capture below - note how Windows groups taskbar icons of the same kind (VirtualBox + virtual machine on the left and two Explorer windows on the right). How would you go about doing this for your own application? Are the icons automatically grouped by process, or can you force Windows to group different processes too?
I've been Googling for this but I'm not quite sure what it is called. All links I've found so far only talk about Windows settings which group / stack / group when full etc.
After a quick Google search, this is what popped up:
Application User Model IDs (AppUserModelIDs) are used extensively by
the taskbar in Windows 7 and later systems to associate processes,
files, and windows with a particular application. In some cases, it is
sufficient to rely on the internal AppUserModelID assigned to a
process by the system. However, an application that owns multiple
processes or an application that is running in a host process might
need to explicitly identify itself so that it can group its otherwise
disparate windows under a single taskbar button and control the
contents of that application's Jump List.
Read more about the topic on msdn.

Why these icons don't combine while my taskbar buttons group policy is "always combine"?

my system is Win7 Ultimate 32bit, and my taskbar buttons group poliy is "Always combine, hide laybels".
There is one program that have some shortcuts, when I open that program by clicking different shortcuts, I found that the icons didn't combine as the policy says.
All these shortcuts are targeted to the same position.
Can anyone tell me why this happen and how to combine all these icons?
Thanks
PS:The system says that I am a new user and have no right to post images....
Applications do have some control over their taskbar appearance but the shortcut used to start them also matters. If one shortcut specifies a App Model Id and a different shortcut does not (One you created perhaps?) then Windows might decide that these are two different apps (Or the same app with separate "modes")
If the application does not call SetCurrentProcessExplicitAppUserModelID then the auto generated Id might also not match if you run 32 and 64 bit versions of the same app...

Mac OS X / Open terminal with specified windows *on specified desktops*

The accepted answer to this question explains how to create a "window group" in Terminal.app so that you can open a set of windows with predefined tabs executing predefined commands in predefined positions.
That's great, but it doesn't appear to play nice with Mission Control. I save my window group with the windows spread out across different desktops in Mission Control, but when I restore the window group they all pile up on top of each other in the desktop I'm currently using!
How can I get a Window Group to restore the windows to the desktops from which I saved them?
Thanks!
Doesn't look like separating application windows by desktop is an option anymore; not according to this MacForums thread.
There's an app called TotalSpaces that claims to restore pre-Mission Control window grouping, but it's a paid app so I haven't tried it.
You might be better off asking this question on AskDifferent or SuperUser...

Resources