# Friday, 02 July 2010
I love demoing restart and recovery. This is the feature that will bring many users to Windows 7 - getting your work back even after the application blows up. Sure, Word saves your document every 20 minutes - but why does it seem I always lose 19 minutes of work? In my simple demo apps, there's a form with one or two controls on it, and one is some text, and when the application blows up I write all the text out, and then on restart I reload it from wherever I wrote it to. It's simple and for most applications it's exactly what you want. But for some applications that approach won't work as well. For example, what if you have an MDI application and the user has 20 or 30 documents open, each with unsaved changes, when the application is terminated? There may not be time to save all those unsaved documents. And then on restart, perhaps the user doesn't want them all restored, or at least not with their real names... it can get complicated.

You are going to need to know your own application and make an intelligent decision about how to handle restart and recovery for your application. But it might help you to know how a certain MDI application near and dear to all our hearts does it ... Visual Studio. Visual Studio does a Word-like autosave every 5 minutes. When the application blows up, it doesn't do anything in particular on the way down. But when it's restarted, it takes a look at the files it has auto recover versions of and asks if you want any of them. You might, you might not, and as the user it's up to you. Zain Naboulsihas a tip-style blog post that explains how it works and how you can control it. Read that for its own sake, since you're probably a Visual Studio user and should be using it as effectively as you can. But also take the opportunity to think about a good design for restart and recovery in your application, which is probably a little more complicated than one text box and one other control.

Kate

Friday, 02 July 2010 20:37:43 (Eastern Daylight Time, UTC-04:00)  #