Download presentation
Presentation is loading. Please wait.
Published byEric Kennedy Modified over 9 years ago
1
Developing with the Windows API Code Pack for.NET Framework
2
Microsoft Confidential
6
Demo
9
> Managed class library to access to Windows (7) features > Windows Shell namespace (supporting for Shell property system) > Taskbar Jumplists, Icon Overlay, Progress bar, Thumbnail, etc… > Windows Task Dialogs, Explorer Browser and other controls > Direct3D 11.0 and DXGI 1.0/1.1 APIs > Sensor Platform APIs > Extended Linguistic Services APIs > Windows Restart Manager > Power APIs > Other…. > http://code.msdn.com/windowsAPICodePack http://code.msdn.com/windowsAPICodePack
10
Version 1.0.1 announcing
12
Main Features > Overlay icons & progress bars > Jump lists (destinations, tasks) > Thumbnail toolbars > Custom thumbnails > Tabbed thumbnails Design Tip > Build a great Taskbar Icon > Forget about Quick Launch and the system tray
13
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);
14
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)
15
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)
16
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)
17
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)
18
Demos
20
IShellLibrary *pIShelLibrary; HRESULT hr = SHCreateLibrary( IID_PPV_ARGS(&pIShelLibrary)); if (SUCCEEDED(hr)) { IShellItem *pIShellItem; SHAddFolderPathToLibrary(pIShelLibrary, L"C:\\Users\\Public\\Documents"); hr = pIShelLibrary- >SaveInKnownFolder(FOLDERID_Libraries, L"My New Library", LSF_MAKEUNIQUENAME, &pIShellItem); pIShellItem->Release(); pIShelLibrary->Release(); } IShellLibrary *pIShelLibrary; HRESULT hr = SHCreateLibrary( IID_PPV_ARGS(&pIShelLibrary)); if (SUCCEEDED(hr)) { IShellItem *pIShellItem; SHAddFolderPathToLibrary(pIShelLibrary, L"C:\\Users\\Public\\Documents"); hr = pIShelLibrary- >SaveInKnownFolder(FOLDERID_Libraries, L"My New Library", LSF_MAKEUNIQUENAME, &pIShellItem); pIShellItem->Release(); pIShelLibrary->Release(); } ShellLibrary library = new ShellLibrary(name, true) library.Add(folderPath); ShellLibrary library = new ShellLibrary(name, true) library.Add(folderPath);
21
Demo
26
> Managed class library to access to Windows (7) features > Windows Shell namespace (supporting for Shell property system) > Taskbar Jumplists, Icon Overlay, Progress bar, Thumbnail, etc… > Windows Task Dialogs, Explorer Browser and other controls > Direct3D 11.0 and DXGI 1.0/1.1 APIs > Sensor Platform APIs > Extended Linguistic Services APIs > Windows Restart Manager > Power APIs > Other…. > http://code.msdn.com/windowsAPICodePack http://code.msdn.com/windowsAPICodePack
28
Q2 / Q3 2010 Ver 2.0 Expanded Shell API coverage Ver 1.5 Fundamentals Mar 2010 Ver – 1.0.1 Bug-fixes Nov 2009 Ver - 1.0 Initial release Aug 2009 Ver - 0.9 Preview June 2009
33
Built by Developers for Developers….
34
© 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
© 2024 SlidePlayer.com. Inc.
All rights reserved.