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)"> 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)">
Download presentation
Presentation is loading. Please wait.
Published byFelix Burns Modified over 9 years ago
18
Application ID Shortcut Jump List Windows Application ID can “fall back” to a larger scope if needed Default computation Process Document Type Registration
19
#include #pragma comment (lib, "shell32.lib") SetCurrentProcessExplicitAppUserModelId( L"Microsoft.Samples.AppId1"); #include #pragma comment (lib, "shell32.lib") SetCurrentProcessExplicitAppUserModelId( L"Microsoft.Samples.AppId1"); TaskbarManager.SetCurrentProcessAppId( "Microsoft.Samples.AppId1"); TaskbarManager.SetCurrentProcessAppId( "Microsoft.Samples.AppId1");
20
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)
26
Destinations (“nouns”) Tasks (“verbs”) Known categories Custom categories User tasks Taskbar tasks Pinned category
28
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");
31
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);
33
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);
36
TasksThumbnail Buttons Entry pointMenu or toolbar Application-wideWindow-specific
37
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)
41
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();
42
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)
43
WinForms: TaskbarManager.SetProgressState(TaskbarProgr essBarState state, IntPtr windowHandle) WPF: TaskbarManager.SetProgressState(TaskbarProgr essBarState state, System.Windows.Window window) WinForms: TaskbarManager.SetProgressState(TaskbarProgr essBarState state, IntPtr windowHandle) WPF: TaskbarManager.SetProgressState(TaskbarProgr essBarState state, System.Windows.Window window)
50
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)
54
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));
55
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;
63
Microsoft Confidential
64
© 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.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.