developing for windows7 with the apicodepack
DESCRIPTION
Slides used to accompany my presentation given at DevEvening on developing for Windows7 using the WindowsAPICodePack.TRANSCRIPT
Developing for Windows 7
matt lacey
@mrlacey - mrlacey.co.uk
Will be looking at:
Taskbar Overlay Images & ProgressJump Lists
Thumbnail PreviewExplorer Browser
Known Folders & Stock IconsCommand Links
Application Restore and Recovery
Not looking at:
Touch Ink
SensorsDirectX
IE8Logo testing
CODE!
Taskbar Overlay Images
if (TaskbarManager.IsPlatformSupported){ TaskbarManager.Instance.SetOverlayIcon(
this.Handle, icon, "AltText");}
Taskbar Progress Bar
if (TaskbarManager.IsPlatformSupported){ TaskbarManager.Instance.SetProgressValue(
value, maximum);
TaskbarManager.Instance.SetProgressState( TaskbarProgressBarState.Normal);
}
Taskbar JumpLists
if (TaskbarManager.IsPlatformSupported){ JumpList jumplist = JumpList.CreateJumpList();
jumplist.KnownCategoryToDisplay = JumpListKnownCategoryType.Recent; jumplist.AddToRecent(pathToFileOfRegisteredType);
jumplist.AddUserTasks(new JumpListLink(path, "label"));
jumplist.Refresh();}
Common Shell Folder Picker
CommonOpenFileDialog dialog = new CommonOpenFileDialog
{
IsFolderPicker = true};
if (dialog.ShowDialog() == CommonFileDialogResult.OK){ explorerBrowser1.Navigate(dialog.FileAsShellObject);
}
KnownFolders
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();
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
More information:
http://code.msdn.microsoft.com /WindowsAPICodePack
http://code.msdn.microsoft.com /Win7DeveloperGuide
http://www.microsoft.com/visualstudio/buildabetterapp/
http://blog.mrlacey.co.uk
twitter.com/mrlacey
Next time:
Christmas CodeFestDecember 3rd