developing for windows7 with the apicodepack

21
Developing for Windows 7 matt lacey @mrlacey - mrlacey.co.uk

Upload: matt-lacey

Post on 14-May-2015

1.628 views

Category:

Technology


1 download

DESCRIPTION

Slides used to accompany my presentation given at DevEvening on developing for Windows7 using the WindowsAPICodePack.

TRANSCRIPT

Page 1: Developing for Windows7 with the APICodepack

Developing for Windows 7

matt lacey

@mrlacey - mrlacey.co.uk

Page 2: Developing for Windows7 with the APICodepack
Page 3: Developing for Windows7 with the APICodepack
Page 4: Developing for Windows7 with the APICodepack

Will be looking at:

Taskbar Overlay Images & ProgressJump Lists

Thumbnail PreviewExplorer Browser

Known Folders & Stock IconsCommand Links

Application Restore and Recovery

Page 5: Developing for Windows7 with the APICodepack

Not looking at:

Touch Ink

SensorsDirectX

IE8Logo testing

Page 6: Developing for Windows7 with the APICodepack
Page 7: Developing for Windows7 with the APICodepack
Page 8: Developing for Windows7 with the APICodepack
Page 9: Developing for Windows7 with the APICodepack

CODE!

Page 10: Developing for Windows7 with the APICodepack

Taskbar Overlay Images

if (TaskbarManager.IsPlatformSupported){ TaskbarManager.Instance.SetOverlayIcon(

this.Handle, icon, "AltText");}

Page 11: Developing for Windows7 with the APICodepack

Taskbar Progress Bar

if (TaskbarManager.IsPlatformSupported){ TaskbarManager.Instance.SetProgressValue(

value, maximum);

TaskbarManager.Instance.SetProgressState( TaskbarProgressBarState.Normal);

}

Page 12: Developing for Windows7 with the APICodepack

Taskbar JumpLists

if (TaskbarManager.IsPlatformSupported){ JumpList jumplist = JumpList.CreateJumpList();

jumplist.KnownCategoryToDisplay = JumpListKnownCategoryType.Recent; jumplist.AddToRecent(pathToFileOfRegisteredType);

jumplist.AddUserTasks(new JumpListLink(path, "label"));

jumplist.Refresh();}

Page 13: Developing for Windows7 with the APICodepack

Common Shell Folder Picker

CommonOpenFileDialog dialog = new CommonOpenFileDialog

{

IsFolderPicker = true};

if (dialog.ShowDialog() == CommonFileDialogResult.OK){ explorerBrowser1.Navigate(dialog.FileAsShellObject);

}

Page 14: Developing for Windows7 with the APICodepack

KnownFolders

Page 15: Developing for Windows7 with the APICodepack

Task Dialog Command Links

TaskDialog taskDlg = new TaskDialog();

TaskDialogCommandLink button = newTaskDialogCommandLink("name", "text");

buttonElevation.Click += new EventHandler(button_Click);

taskDlg.Controls.Add(buttonError);

taskDlg.Show();

Page 16: Developing for Windows7 with the APICodepack

ApplicationRestartRecoveryManager

// This works in Vista but there was no managed way of doing this before!ApplicationRestartRecoveryManager.

RegisterForApplicationRestart(new RestartSettings("restart",

RestartRestrictions.None));

This is the simplest way of forcing an app restart when it crashes

Page 17: Developing for Windows7 with the APICodepack
Page 18: Developing for Windows7 with the APICodepack

More information:

http://code.msdn.microsoft.com /WindowsAPICodePack

http://code.msdn.microsoft.com /Win7DeveloperGuide

http://www.microsoft.com/visualstudio/buildabetterapp/

Page 19: Developing for Windows7 with the APICodepack

http://blog.mrlacey.co.uk

twitter.com/mrlacey

Page 20: Developing for Windows7 with the APICodepack
Page 21: Developing for Windows7 with the APICodepack

Next time:

Christmas CodeFestDecember 3rd