PDC09 – Pre-Conference – Windows Bootcamp Part 4/6 – Windows 7 Taskbar
Key Goals
- Things you use all the time are at your fingerprints
- Manage your windows with confidence
- You are in control
- Clean and lightweight
Coding for the Windows Taskbar
-
Win32/C++
-
COM
- iTaskbarList3
- ICustomDestinationList
- IShellItem
- IShellLink
-
COM
-
.NET
-
Windows API Codepack
- Taskmanager
- JumpList
- JumpListItem
-
Windows API Codepack
How are Windows Grouped?
-
ApplicationID
-
It’s a String, not a GUID
- Limited to 128 characters
- Naming Conventions – Company.Product.SubProduct
-
Design Considerations
- Default: Computed by process name
-
Can be explicitly declared
- Several executables, same application
- Same executables (host), many applications
- Multiple shortcuts
-
Setting the ApplicationID
- Process-wide – affects all windows in the current process
-
C++
- SetCurrentProcessExplicjtAppUserModelId(L”Microsoft.Samples.AppId1”)
-
.NET
- TaskbarManager.SetCurrentProcessId(“Microsoft.Samples.AppId1”)
-
It’s a String, not a GUID
Taskbar Buttons
-
Consolidation
- Quick launch
- Notification area icon
- Desktop shortcut
- Running application Windows
-
Design Considerations
- Only users can pin applications to taskbar
- The icon’s hot-track color us the icon dominant color
- Test icons with High DPI
- Test with with various themes and glass colors
-
Get More from Taskbar Buttons
-
Overlay and Progress
-
Design considerations
-
Notification area is now user controlled
- Leave yourself out if possible
- Use taskbar buttons for custom progress or status information
-
Notification area is now user controlled
-
Design considerations
-
Overlay and Progress
-
Thumbnail toolbars
-
Design Considerations
-
You’ll get up to 7 buttons (hard-coded limit)
- Once added, can’t delete
- Can hide and disable
-
Behave as regular buttons
- Listen to Events
-
You’ll get up to 7 buttons (hard-coded limit)
-
API
-
C++
- RegisterWindowMessage
- ThumbBarAddButton
-
.NET
- AddButtoons(IntPtr windowHandle, params ThumbnailToolbarButton[]) – WindowsForms
- AddButtons(UIElement element, params ThumbnailToolbarButton[]) – WPF
-
C++
-
Design Considerations
-
Live Thumbnails
-
Custom Window Switchers
- Use ITaskbarList3::RegisterTab, SetTabOrder
-
Custom Window Switchers
Taskbar + Windows Shell
-
Application Support
- Common file dialogs
- Known folders and libraries
- Property System
-
Terminology
- IShellItem – represents folders and files
- IShellLink – represents shell shortcuts
- IShellFolder – represents folders
-
Jump List
-
It’s a mini Start Menu for the application
- The user is in control of what is part of the Jump List
-
Detailed Look
-
Destination (nouns) – Items that will be worked
- Pinned Category
-
Known Category
-
Only 2 Known category exist and mutually
exclusive on the API
- Recent
- Frequent
-
Only 2 Known category exist and mutually
exclusive on the API
- Custom Category
-
Tasks (verbs) - Actions
- User Tasks
- Taskbar Tasks
-
Destination (nouns) – Items that will be worked
-
Design Considerations
-
Surface key destinations and tasks
- Recent and frequent are free
- Pinned is also free (if the user uses it)
- Respect items the user removes
-
Surface key destinations and tasks
-
It’s a mini Start Menu for the application