application id shortcut jump list windows application id can “fall back” to a larger scope if...

63

Upload: felix-burns

Post on 21-Jan-2016

224 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Application ID Shortcut Jump List Windows Application ID can “fall back” to a larger scope if needed Default computation
Page 2: Application ID Shortcut Jump List Windows Application ID can “fall back” to a larger scope if needed Default computation
Page 3: Application ID Shortcut Jump List Windows Application ID can “fall back” to a larger scope if needed Default computation
Page 4: Application ID Shortcut Jump List Windows Application ID can “fall back” to a larger scope if needed Default computation
Page 5: Application ID Shortcut Jump List Windows Application ID can “fall back” to a larger scope if needed Default computation
Page 6: Application ID Shortcut Jump List Windows Application ID can “fall back” to a larger scope if needed Default computation
Page 7: Application ID Shortcut Jump List Windows Application ID can “fall back” to a larger scope if needed Default computation
Page 8: Application ID Shortcut Jump List Windows Application ID can “fall back” to a larger scope if needed Default computation
Page 9: Application ID Shortcut Jump List Windows Application ID can “fall back” to a larger scope if needed Default computation
Page 10: Application ID Shortcut Jump List Windows Application ID can “fall back” to a larger scope if needed Default computation
Page 11: Application ID Shortcut Jump List Windows Application ID can “fall back” to a larger scope if needed Default computation
Page 12: Application ID Shortcut Jump List Windows Application ID can “fall back” to a larger scope if needed Default computation
Page 13: Application ID Shortcut Jump List Windows Application ID can “fall back” to a larger scope if needed Default computation
Page 14: Application ID Shortcut Jump List Windows Application ID can “fall back” to a larger scope if needed Default computation
Page 15: Application ID Shortcut Jump List Windows Application ID can “fall back” to a larger scope if needed Default computation
Page 16: Application ID Shortcut Jump List Windows Application ID can “fall back” to a larger scope if needed Default computation
Page 17: Application ID Shortcut Jump List Windows Application ID can “fall back” to a larger scope if needed Default computation
Page 18: Application ID Shortcut Jump List Windows Application ID can “fall back” to a larger scope if needed Default computation

Application IDApplication ID

ShortcutShortcut

Jump ListJump List

WindowsWindows

Application ID can “fall back”to a larger scope if needed

Default computatio

n

ProcessProcess

Document Type

Registration

Document Type

Registration

Page 19: Application ID Shortcut Jump List Windows Application ID can “fall back” to a larger scope if needed Default computation

#include <windows.h>#pragma comment (lib, "shell32.lib")

SetCurrentProcessExplicitAppUserModelId(L"Microsoft.Samples.AppId1");

#include <windows.h>#pragma comment (lib, "shell32.lib")

SetCurrentProcessExplicitAppUserModelId(L"Microsoft.Samples.AppId1");

TaskbarManager.SetCurrentProcessAppId("Microsoft.Samples.AppId1");

TaskbarManager.SetCurrentProcessAppId("Microsoft.Samples.AppId1");

Page 20: Application ID Shortcut Jump List Windows Application ID can “fall back” to a larger scope if needed Default computation

PROPVARIANT pv;InitPropVariantFromString(

L"Microsoft.Samples.AppId2", &pv);IPropertyStore *pps;HRESULT hr = SHGetPropertyStoreForWindow(

hWnd, IID_PPV_ARGS(&pps));pps->SetValue(PKEY_AppUserModel_ID, pv);

PROPVARIANT pv;InitPropVariantFromString(

L"Microsoft.Samples.AppId2", &pv);IPropertyStore *pps;HRESULT hr = SHGetPropertyStoreForWindow(

hWnd, IID_PPV_ARGS(&pps));pps->SetValue(PKEY_AppUserModel_ID, pv);

WinForms: TaskbarManager. SetApplicationIdForSpecificWindow(IntPtr windowHandle, string appId)

WPF: TaskbarManager. SetApplicationIdForSpecificWindow (System.Windows.Window window, string appId)

WinForms: TaskbarManager. SetApplicationIdForSpecificWindow(IntPtr windowHandle, string appId)

WPF: TaskbarManager. SetApplicationIdForSpecificWindow (System.Windows.Window window, string appId)

Page 21: Application ID Shortcut Jump List Windows Application ID can “fall back” to a larger scope if needed Default computation
Page 22: Application ID Shortcut Jump List Windows Application ID can “fall back” to a larger scope if needed Default computation
Page 23: Application ID Shortcut Jump List Windows Application ID can “fall back” to a larger scope if needed Default computation
Page 24: Application ID Shortcut Jump List Windows Application ID can “fall back” to a larger scope if needed Default computation
Page 25: Application ID Shortcut Jump List Windows Application ID can “fall back” to a larger scope if needed Default computation
Page 26: Application ID Shortcut Jump List Windows Application ID can “fall back” to a larger scope if needed Default computation

Destinations(“nouns”)

Tasks(“verbs”)

Known categories

Custom categories

User tasks

Taskbar tasks

Pinned category

Page 27: Application ID Shortcut Jump List Windows Application ID can “fall back” to a larger scope if needed Default computation
Page 28: Application ID Shortcut Jump List Windows Application ID can “fall back” to a larger scope if needed Default computation

SHAddToRecentDocs(SHARDW_PATH, "file.ext");SHAddToRecentDocs(SHARDW_PATH, "file.ext");

RH.RegisterFileAssociations(...);OpenFileDialog ofd = ...; ofd.ShowDialog();JumpList jl = ...;jl.AddToRecent("file.ext");

RH.RegisterFileAssociations(...);OpenFileDialog ofd = ...; ofd.ShowDialog();JumpList jl = ...;jl.AddToRecent("file.ext");

Page 29: Application ID Shortcut Jump List Windows Application ID can “fall back” to a larger scope if needed Default computation
Page 30: Application ID Shortcut Jump List Windows Application ID can “fall back” to a larger scope if needed Default computation
Page 31: Application ID Shortcut Jump List Windows Application ID can “fall back” to a larger scope if needed Default computation

IObjectCollection* poc = ...;IShellLink* task = ...;Poc->AddObject(task);ICustomDestinationList* pcdl = ...;Pcdl->BeginList(...);IObjectArray* poa = ... poc;Pcdl->AddUserTasks(poa);Pcdl->CommitList();

IObjectCollection* poc = ...;IShellLink* task = ...;Poc->AddObject(task);ICustomDestinationList* pcdl = ...;Pcdl->BeginList(...);IObjectArray* poa = ... poc;Pcdl->AddUserTasks(poa);Pcdl->CommitList();

JumpList jl = ...;jl.AddUserTasks(params IJumpListTask[] tasks);

JumpList jl = ...;jl.AddUserTasks(params IJumpListTask[] tasks);

Page 32: Application ID Shortcut Jump List Windows Application ID can “fall back” to a larger scope if needed Default computation
Page 33: Application ID Shortcut Jump List Windows Application ID can “fall back” to a larger scope if needed Default computation

IObjectCollection* poc = ...;IShellItem* item = ...;Poc->AddObject(item);ICustomDestinationList* pcdl = ...;Pcdl->BeginList(...);IObjectArray* poa = ... poc;Pcdl->AppendCategory(L"Sales", poa);Pcdl->CommitList();

IObjectCollection* poc = ...;IShellItem* item = ...;Poc->AddObject(item);ICustomDestinationList* pcdl = ...;Pcdl->BeginList(...);IObjectArray* poa = ... poc;Pcdl->AppendCategory(L"Sales", poa);Pcdl->CommitList();

JumpList jl = ...;jlm.AddCustomDestination(params JumpListCustomCategory[] customCategories);

JumpList jl = ...;jlm.AddCustomDestination(params JumpListCustomCategory[] customCategories);

Page 34: Application ID Shortcut Jump List Windows Application ID can “fall back” to a larger scope if needed Default computation
Page 35: Application ID Shortcut Jump List Windows Application ID can “fall back” to a larger scope if needed Default computation

Tasks Thumbnail Buttons

Entry point Menu or toolbar

Application-wide Window-specific

Page 36: Application ID Shortcut Jump List Windows Application ID can “fall back” to a larger scope if needed Default computation

UINT wm_tbc = RegisterWindowMessage("TaskbarButtonCreated");

MSG m; GetMessage(..., &m);if (m.message == wm_tbc) { ITaskbarList3* ptl = ...; THUMBBUTTON btn = {...}; ptl->ThumbBarAddButtons(m.hWnd, 1, &btn);}

UINT wm_tbc = RegisterWindowMessage("TaskbarButtonCreated");

MSG m; GetMessage(..., &m);if (m.message == wm_tbc) { ITaskbarList3* ptl = ...; THUMBBUTTON btn = {...}; ptl->ThumbBarAddButtons(m.hWnd, 1, &btn);}

WinForms: AddButtons(IntPtr windowHandle, params ThumbnailToolbarButton[] buttons)

WPF: AddButtons(UIElement control, params ThumbnailToolbarButton[] buttons)

WinForms: AddButtons(IntPtr windowHandle, params ThumbnailToolbarButton[] buttons)

WPF: AddButtons(UIElement control, params ThumbnailToolbarButton[] buttons)

Page 37: Application ID Shortcut Jump List Windows Application ID can “fall back” to a larger scope if needed Default computation
Page 38: Application ID Shortcut Jump List Windows Application ID can “fall back” to a larger scope if needed Default computation
Page 39: Application ID Shortcut Jump List Windows Application ID can “fall back” to a larger scope if needed Default computation
Page 40: Application ID Shortcut Jump List Windows Application ID can “fall back” to a larger scope if needed Default computation

ITaskbarList3* ptl = ...;ptl->SetOverlayIcon( hwnd, hicon, L"Accessible Description");ptl->SetProgressState(hwnd, TBPF_NORMAL);for (int i = 0; i < MAX; ++i) { ptl->SetProgressValue(hwnd, i, MAX);}

ITaskbarList3* ptl = ...;ptl->SetOverlayIcon( hwnd, hicon, L"Accessible Description");ptl->SetProgressState(hwnd, TBPF_NORMAL);for (int i = 0; i < MAX; ++i) { ptl->SetProgressValue(hwnd, i, MAX);}myForm.SetTaskbarOverlayIcon(icon, "...");ProgressBar pb = ...;pb.SetTaskbarProgress();

myForm.SetTaskbarOverlayIcon(icon, "...");ProgressBar pb = ...;pb.SetTaskbarProgress();

Page 41: Application ID Shortcut Jump List Windows Application ID can “fall back” to a larger scope if needed Default computation

WinForms: TaskbarManager.SetOverlayIcon(IntPtr windowHandle, System.Drawing.Icon icon, string accessibilityText)

WPF: TaskbarManager.SetOverlayIcon (System.Windows.Window window, System.Drawing.Icon icon, string accessibilityText)

WinForms: TaskbarManager.SetOverlayIcon(IntPtr windowHandle, System.Drawing.Icon icon, string accessibilityText)

WPF: TaskbarManager.SetOverlayIcon (System.Windows.Window window, System.Drawing.Icon icon, string accessibilityText)

Page 42: Application ID Shortcut Jump List Windows Application ID can “fall back” to a larger scope if needed Default computation

WinForms: TaskbarManager.SetProgressState(TaskbarProgressBarState state, IntPtr windowHandle)

WPF: TaskbarManager.SetProgressState(TaskbarProgressBarState state, System.Windows.Window window)

WinForms: TaskbarManager.SetProgressState(TaskbarProgressBarState state, IntPtr windowHandle)

WPF: TaskbarManager.SetProgressState(TaskbarProgressBarState state, System.Windows.Window window)

Page 43: Application ID Shortcut Jump List Windows Application ID can “fall back” to a larger scope if needed Default computation
Page 44: Application ID Shortcut Jump List Windows Application ID can “fall back” to a larger scope if needed Default computation
Page 45: Application ID Shortcut Jump List Windows Application ID can “fall back” to a larger scope if needed Default computation
Page 46: Application ID Shortcut Jump List Windows Application ID can “fall back” to a larger scope if needed Default computation
Page 47: Application ID Shortcut Jump List Windows Application ID can “fall back” to a larger scope if needed Default computation
Page 48: Application ID Shortcut Jump List Windows Application ID can “fall back” to a larger scope if needed Default computation
Page 49: Application ID Shortcut Jump List Windows Application ID can “fall back” to a larger scope if needed Default computation

DwmSetWindowAttribute( ...,DWMWA_HAS_ICONIC_BITMAP,...);DwmSetWindowAttribute(...,DWMWA_FORCE_ICONIC_REPRESENTATION,...);/* in the WndProc */case WM_DWMSENDICONICTHUMBNAIL: HBITMAP hbm = ...; DwmSetIconicThumbnail(hwnd, hbm, ...);

DwmSetWindowAttribute( ...,DWMWA_HAS_ICONIC_BITMAP,...);DwmSetWindowAttribute(...,DWMWA_FORCE_ICONIC_REPRESENTATION,...);/* in the WndProc */case WM_DWMSENDICONICTHUMBNAIL: HBITMAP hbm = ...; DwmSetIconicThumbnail(hwnd, hbm, ...);TabbedThumbnailManager ttm = ...;ttm. AddThumbnailPreview(TabbedThumbnail preview)

TabbedThumbnailManager ttm = ...;ttm. AddThumbnailPreview(TabbedThumbnail preview)

Page 50: Application ID Shortcut Jump List Windows Application ID can “fall back” to a larger scope if needed Default computation
Page 51: Application ID Shortcut Jump List Windows Application ID can “fall back” to a larger scope if needed Default computation
Page 52: Application ID Shortcut Jump List Windows Application ID can “fall back” to a larger scope if needed Default computation
Page 53: Application ID Shortcut Jump List Windows Application ID can “fall back” to a larger scope if needed Default computation

BOOL truth = TRUE;DwmSetWindowAttribute( hwnd, DWMWA_HAS_ICONIC_BITMAP, &truth, sizeof(truth));DwmSetWindowAttribute( hwnd, DWMWA_FORCE_ICONIC_REPRESENTATION, &truth, sizeof(truth));

BOOL truth = TRUE;DwmSetWindowAttribute( hwnd, DWMWA_HAS_ICONIC_BITMAP, &truth, sizeof(truth));DwmSetWindowAttribute( hwnd, DWMWA_FORCE_ICONIC_REPRESENTATION, &truth, sizeof(truth));

Page 54: Application ID Shortcut Jump List Windows Application ID can “fall back” to a larger scope if needed Default computation

case WM_DWMSENDICONICTHUMBNAIL: width = HIWORD(lParam); height = LOWORD(lParam); hbm = GetBitmap(..., width, height); DwmSetIconicThumbnail(hwnd, hbm, 0); break;case WM_DWMSENDICONICLIVEPREVIEWBITMAP: hbm = GetBitmap(...); DwmSetIconicLivePreviewBitmap(hwnd,hbm,0); break;

case WM_DWMSENDICONICTHUMBNAIL: width = HIWORD(lParam); height = LOWORD(lParam); hbm = GetBitmap(..., width, height); DwmSetIconicThumbnail(hwnd, hbm, 0); break;case WM_DWMSENDICONICLIVEPREVIEWBITMAP: hbm = GetBitmap(...); DwmSetIconicLivePreviewBitmap(hwnd,hbm,0); break;

Page 55: Application ID Shortcut Jump List Windows Application ID can “fall back” to a larger scope if needed Default computation
Page 56: Application ID Shortcut Jump List Windows Application ID can “fall back” to a larger scope if needed Default computation
Page 57: Application ID Shortcut Jump List Windows Application ID can “fall back” to a larger scope if needed Default computation
Page 58: Application ID Shortcut Jump List Windows Application ID can “fall back” to a larger scope if needed Default computation
Page 59: Application ID Shortcut Jump List Windows Application ID can “fall back” to a larger scope if needed Default computation
Page 60: Application ID Shortcut Jump List Windows Application ID can “fall back” to a larger scope if needed Default computation
Page 61: Application ID Shortcut Jump List Windows Application ID can “fall back” to a larger scope if needed Default computation
Page 62: Application ID Shortcut Jump List Windows Application ID can “fall back” to a larger scope if needed Default computation

Microsoft Confidential

Page 63: Application ID Shortcut Jump List Windows Application ID can “fall back” to a larger scope if needed Default computation

© 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.

The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after

the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.