Presentation is loading. Please wait.

Presentation is loading. Please wait.

Yochay Kiriaty Senior Technical Evangelist Microsoft Corporation SESSION CODE: WCL312.

Similar presentations


Presentation on theme: "Yochay Kiriaty Senior Technical Evangelist Microsoft Corporation SESSION CODE: WCL312."— Presentation transcript:

1 Yochay Kiriaty Senior Technical Evangelist Microsoft Corporation SESSION CODE: WCL312

2

3 Microsoft Confidential

4

5

6

7

8

9

10

11 @shell32.dll,-34575 imageres.dll,-1002 {7d49d726-3c21-4f05-99aa-fdc2c9474656} … @shell32.dll,-34575 imageres.dll,-1002 {7d49d726-3c21-4f05-99aa-fdc2c9474656} …

12

13

14 Method Name SHAddFolderPathToLibraryAdds a folder to a library SHCreateLibraryCreates an IShellLibrary object SHLoadLibraryFromItem Creates and loads an IShellLibrary object from a specified library definition file SHLoadLibraryFromKnownFolder Creates and loads an IShellLibrary object for a specified KNOWNFOLDERID SHLoadLibraryFromParsingName Creates and loads an IShellLibrary object for a specified path SHRemoveFolderPathFromLibraryRemoves a folder from a library SHResolveFolderPathInLibrary Resolve the target location of a library folder that has been moved or renamed SHSaveLibraryInFolderPathSaves an IShellLibrary object to disk

15 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(); }

16 //Create new library and add a folder using (ShellLibrary library = new ShellLibrary(name, true)) { library.Add(folderPath); } //Load the document library, add new folder, pin to nav pan using (ShellLibrary lib = ShellLibrary.Load( "Documents", false)) { lib.Add(@"C:\"); lib.IsPinnedToNavigationPane = true; lib.DefaultSaveFolder = @"C:\"; }

17

18

19 Document repository Enterprise data store Enterprise application

20

21

22 Help Button Contextual Tab Contextual Tab Group Tab Quick Access Toolbar Quick Access Toolbar Application Menu Group

23 Windows Ribbon void DoStuff() { … } MyHandler::Execute(…) { DoStuff(); }

24

25

26 Running Not running Multiple windows and hover Active

27

28 #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");

29 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)

30

31 Destinations (“nouns”) Tasks (“verbs”) Known categories Custom categories User tasks Taskbar tasks Pinned category

32

33 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");

34

35 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);

36

37 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);

38 http://channel9.msdn.com/posts/yochay/Programming-the-Windows-7-Taskbar--Jump-Lists-Part-2/

39

40

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

44 http://channel9.msdn.com/posts/yochay/Programming-the-Windows-7-Taskbar--Using-the-Taskbar-Button- Overlay-Icons-and-Progress-Bars/

45

46

47

48

49 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 = new...; ttm.AddThumbnailPreview(TabbedThumbnail preview) TabbedThumbnailManager ttm = new...; ttm.AddThumbnailPreview(TabbedThumbnail preview)

50 http://channel9.msdn.com/posts/yochay/Programming-the-Windows-7-Taskbar--Custom-Previews-and-Thumbnail-Clips/

51

52

53 http://channel9.msdn.com/posts/yochay/Programming-the-Windows-7-Taskbar--Tabbed- Thumbnails/

54

55

56

57

58 What is the Springboard Series? To the IT pro, our goal is Be the definitive resource for Desktop IT pros Open, honest; show don’t tell Information at right time, right level across Adoption Lifecycle Inside of Microsoft we are A turnkey IT pro engagement platform for depth and breadth The program to mobilize MS marketing and field to focus on desktop OS IT pros DEPLOYPILOTMANAGEEXPLOREDISCOVER one-Windows TechCenter in 10 languages Virtual Roundtable Events Springboard Technical Experts Panel Event Support and Resources Straight-talk Monthly Feature Articles and Overview Guides TalkingAboutWindows Video Blogs

59 www.microsoft.com/teched www.microsoft.com/learning http://microsoft.com/technet http://microsoft.com/msdn

60

61 Sign up for Tech·Ed 2011 and save $500 starting June 8 – June 31 st http://northamerica.msteched.com/registration You can also register at the North America 2011 kiosk located at registration Join us in Atlanta next year

62

63


Download ppt "Yochay Kiriaty Senior Technical Evangelist Microsoft Corporation SESSION CODE: WCL312."

Similar presentations


Ads by Google