Developing with the Windows API Code Pack for .NET Framework Microsoft.

Download Report

Transcript Developing with the Windows API Code Pack for .NET Framework Microsoft.

Developing with the Windows API
Code Pack for .NET Framework
Microsoft
>
>
>
>
>
>
>
>
>
>
>
>
>
Demo
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> 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
announcing
Version 1.0.1
Shell
>
>
>
>
>
>
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
Adding tasks
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);
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)
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)
WinForms
AddButtons(IntPtr windowHandle,
params
ThumbnailToolbarButton[] buttons)
WPF:
AddButtons(UIElement control,
params
ThumbnailToolbarButton[] buttons)
WinForms
TaskbarManager.SetOverlayIcon(
IntPtr windowHandle,
System.Drawing.Icon icon,
string accessibilityText)
WPF
TaskbarManager.SetOverlayIcon(
System.Windows.Window window,
System.Drawing.Icon icon,
string accessibilityText)
Demos
>
>
>
>
>
>
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);
Demo
>
>
>
>
>
>
>
>
>
Demo
Demo
> 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
Ver - 0.9
Preview
Ver – 1.0.1
Bug-fixes
Ver 1.5
Fundamentals
Ver - 1.0
Initial release
June
2009
Ver 2.0
Expanded Shell
API coverage
Aug
2009
Nov
2009
Mar
2010
Q2 / Q3
2010
>
>
>
>
>
>
>
>
>
>
> http://msdn.microsoft.com/en-us/windows/default.aspx
>
>
http://channel9.msdn.com/learn/windows
>
> http://windowsteamblog.com/blogs/developers/default
.aspx
>
> http://channel9.msdn.com/windows
>
>
channel9.msdn.com/learn
Built by Developers for Developers….
© 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.
>
>
>
>
>
>
>
>