Previous Page Page 3 of 5 in the Win7 category Next Page

New VB Home PageThe team I work at Microsoft for is called Server and Tools Online, and one of the things we work on is the Microsoft Developer Network or "MSDN." If you go way, way up, our boss is Soma (Yes, this Soma), but down here in the trenches there's the folks that make content and systems to help you after you "File | New Project."

Our goals this year are to get back to basics and make sure that our online user experience meets these goals in as few clicks as possible.

PREVIEW: Check out the Live Preview of the new VB Dev Center. Other centers will follow.

INTERNATIONAL UPDATE: Our international team members are writing blog posts of their own:

A few months ago I snuck a few "comps" out of a meeting with the designers on MSDN. A few months before that we talked about the a upcoming "loband" option for MSDN and performance improvements to the MSDN library that are bringing page-load times for the MSDN library to the 1- and 2-second level.

There was a lot of great comments and feedback from you in the comments of both of those posts and I took it all straight to the teams.

There's a bunch of big stuff going on in the next few months. We've got a new Operating System (Windows 7 is launching on Oct 22, in case you've been living in a cave, or a small home office like me) coming, there's also Microsoft's PDC November 17-19, and you know how we like to announce fun stuff at PDC. :)

I've got a bunch of comps (these are not final) from a recent meeting I wanted to share with you about what's new at MSDN to support all this newness and fix some old problems.

New MSDN - Why?

To be clear, this is more than a "visual refresh." Sure, there's a new design and it's pretty, but this is more about UX (User Experience) than it is about swapping out icons. We've got 5 main goals as a team to enable you, Dear Reader:

  1. HELP ME - I've got a problem. What's the answer, quickly and accurately.
  2. CONNECT ME TO PEOPLE - There's other people like me, connect me to them, and to the product group.
  3. GET ME THE DOWNLOAD I NEED - Get out of my way, I just want a download. Bits, Scripts, Utils, Code, etc.
  4. CONNECT ME TO THE PRODUCT - What's new with Product X? I've got feedback and I want to be heard.
  5. KEEP ME SMART - I'm looking to sharpen the saw.

Our goals are to be transparent and authentic. I think you've seen that on this blog since day 0, and hopefully in the last two years after I joined Microsoft. The web continues to evolve and we want an MSDN that better reflects a focus on community, on fresh content, and on making things easier to find.

What's Coming

We'll be launching an entirely new MSDN very soon and I'll have all the details for you, Dear Reader, here on my blog. You'll be able to see a live pilot of the new design in the VB Dev Center this week. This will be part of an ongoing reinvention that will span the next year. We'll be listening to you and making sure you're getting what you need. For now it's at /vbpreview, and soon you'll see it the new layout at /vbasic and all of MSDN will change.

We're adding guidance for new developers on every Dev Center Home Page. There's also a renewed focus on consistency across the whole network. You'll find Related Content in the right margin throughout the network and primary content top center of every page.

BLOG_VISUALIZER

There's a number of new active controls with dynamic community content. More content than ever will be driven by feeds and tagged so the freshest and most relevant content is easy to find.

Learning

Another focus is learning, particularly around educational videos and screencasts. There's a pile of them, but historically it's been hard to find the ones that apply to you, and no way to add comments and questions. This release adds video sharing, comments and ratings. There's also plans for a new video scroller - this is an artist's rendering I found in a design PPT.

Videos

Community Activity

More areas of the home page will be active content driven by feeds and bring people with interesting content, comments, code and perspectives to the front. It'll be easy to find what's new and what's popular in Forums, Galleries, Video and Code.

Community Activity

Downloads

Another point of focus for this first upcoming release is downloads. I've been beating the downloads drum since I got here and this release changes puts Downloads right up front. The downloads are better organized and all consistent. The Top downloads and samples are more visible and updated more often, putting them often within two clicks.

Even More To Come

I hope you'll agree when you see the new site that it's got better discoverability, readability, consistency and most importantly, more relevant content. You'll see more fewer, more focused Dev Centers, more task-oriented content, and more community content.

This is all the start of a leaner meaner MSDN and it's just the first "wave." I'll post about some other cool changes that we've got coming down the pipe soon.

Be Heard

A lot of people are working hard to make MSDN fresher, more relevant, faster and easier to navigate. Everyone is actively monitoring the MSDN Feedback Forum so if you've got questions, concerns, feedback, ideas or compliments, that's the spot. You can also post here in the comments and I'll make sure the right people hear what you've got to say!



For those of you (and me) who manage more than one computer or remote into many computers or virtual machines, it can be very hard to remember which machine you're on.

There are many solutions out there for stamping your computer name. Most often I see people creating custom wallpaper using a tool like BgInfo. However, you can't always see your desktop, I like a more persistent solution.

The only thing that is always on my screen is the taskbar. Here's how to add your Computer Name to the Taskbar.

  • First, go to your Documents folder, or any folder, really. Make a new folder and name that folder the same name as your computer. So, now I have c:\users\scottha\documents\HANSELMAN-W500.
  • Next, Right-Click on an empty area in the taskbar and click Toolbars, then new Toolbar.

image

  • Now, select the new folder you named the same as your Toolbar and click "Select Folder."

Bam.

image

Doesn't that look nice?

Thanks to Brad Wilson for the tip. I'll be doing this to all my machines.


image I really advocate folks reading as much source as they can because you become a better writer by reading as much as writing. That's the whole point of the Weekly Source Code - reading code to be a better developer.

There's a very cool developer context going on right now called "Code7." If you code a Windows 7 application between now and October 7 you could win a giant bag of money and/or a trip to PDC.

There's a pile of new APIs in Windows 7 (as well as existing and useful Vista APIs) like these:

  • Windows 7 Taskbar Integration
  • Transactional File System
  • I/O Optimization
  • Event Tracing for Windows (ETW)
  • Windows 7 Libraries
  • Windows 7 Sensor and Location Platform
  • Aero Glass

In some of these instances, there isn't hardware (yet) for things like Ambient Light Sensors. One dude has taken a Webcam and hooked it into the Windows 7 Sensors API and made a program to dim his monitors with the new Monitor Configuration API*. He might even make it turn off his machine when he walks away.

XP2Win7 - Windows 7 Sample Code/Application

I've been checking out what sample applications there are to start learning about Windows 7. The coolest so far as been the "PhotoView" application. Don't sweat the fact it's YAPA (Yet Another Photo Application) and consider it a loosely confederated collection of samples.

MainWindow

What's cool about this application is that it works on Windows XP and Windows Vista and Windows 7. This may be obvious and even a silly statement to you, Dear Reader, but it's a nice reminder that and app can be awesome on all three platforms. 99% of the apps that I use work great on Windows 7. Sure, some drivers and wacky VPN things will need to be updated, but it's comforting to me to know I can write an app for Windows that will, um, work on Windows. ;)

This PhotoView application, also called XP2Win7 is written managed code and uses plugins to "light up on up-level platforms." That's fancy Microsoft talk that means if your operating system has a feature the app will detect it and use it.

There's a great overview Word Document that explains the app and how it is written. The MSI will install the app, then optionally the source in ~\MyDocuments\Xp2Win7 if you have trouble finding it. You'll need Visual C++ if you want to build a few parts...just read the readme. It's a pretty extraordinarily broad sample with examples on how to make MMC ReportViewer snapins, delayed services, register scheduled tasks, piles.

(Unfortunately the guys that wrote this didn't use MEF for their plugin model, but I'll talk to them. It would allow them to remove a lot of boilerplate plugin monkey code.)

It uses the Windows API Code Pack (I talk about this below) to do a lot of its work. Here's a few fun parts.

TaskBar JumpLists

When the app is run under Windows 7 it includes "jumplists" when you right-click (or swipe-up) on the taskbar button:

image

This is easily added with the Taskbar API. Notice the multiple categories, user tasks, recent items, and custom categories.

Taskbar.JumpList.CustomCategories.Clear();
Taskbar.JumpList.UserTasks.Clear();
Taskbar.JumpList.KnownCategoryToDisplay = KnownCategoryType.Recent;

CustomCategory allAlbumsCategory = new CustomCategory("All Albums");
//...snip out enumerating of the filesystem to get photo albums
Taskbar.JumpList.CustomCategories.Add(allAlbumsCategory);

Taskbar.JumpList.UserTasks.Add(
new JumpListLink()
{
Title = "Reset configuration",
Path = typeof(XP2Win7.VistaPlugins.ConfigurationResetter.Program).Assembly.Location,
Arguments = XP2Win7.VistaPlugins.ConfigurationResetter.Program.ResetCommand
});
Taskbar.JumpList.UserTasks.Add(
new JumpListLink
{
Title = "Launch indexing task",
Path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, Constants.ServiceCommandLine),
Arguments = Constants.ServiceAsTaskCommandLine
});
Taskbar.JumpList.UserTasks.Add(
new JumpListLink { Title = "Open albums directory", Path = Host.UserConfiguration.AlbumRepositoryPath });

Taskbar.JumpList.RefreshTaskbarList();

Windows 7 Libraries

You can also add Windows 7 Libraries for your application:

//Create new shell library under the default Libraries
using (ShellLibrary library = new ShellLibrary("XP2Win7", true))
{
library.LibraryType = LibraryFolderType.Pictures;
library.IconResourceId = GetPictureLibraryIcon(); //Set the same Icon as the Picture library
library.IsPinnedToNavigationPane = true;


foreach (string folderPath in GetPicturesFolders())
{
library.Add(folderPath);
}

library.ShowManageLibraryUI(Application.Current.MainWindow,
"Manage the XP2Win7 library", "You can manualy add or remove folders",
true);
}

User Access Control (UAC)

Windows Vista and Windows 7 both include User Access Control (UAC). You'll recognize the little shield icon next to a button that will require a prompt from the user in the dialog below.

Application reconfiguration

Their application uses this in a few places. First, can we even show the little shield? We only want to do that if UAC is enabled:

protected override BitmapSource BitmapSource
{
get
{
if (UacHelpers.UserAccountControl.IsUacEnabled)
{
return Microsoft.SDK.Samples.VistaBridge.Library.StockIcons.StockIcons.Shield;
}
else
{
return ImageFromResource(Assembly.GetExecutingAssembly(),
"UserAccountControl.StartService-128x128.png");
}
}
}

Then, if they do click the button, and we want to launch some process as Administrator, we'll need to call a special API to do that. This is mean easy by helper APIs.

if (UacHelpers.UserAccountControl.IsUacEnabled || !UacHelpers.UserAccountControl.IsUserAdmin)
{
UacHelpers.UserAccountControl.CreateProcessAsAdmin(
typeof(ServiceStarter.Program).Assembly.Location, "XP2Win7ImageDataService");
}
else
{
Process.Start(typeof(ServiceStarter.Program).Assembly.Location, "XP2Win7ImageDataService");
}

Pretty slick and easy to code. The Windows API Code Pack makes all these APIs and dozens more easy for managed code developers (C#, VB, and everyone else.)

Windows API Code Pack

Another great pile of Windows sample code is the Windows API Code Pack. This thing is a gold mine of samples and they are all in C# and VB. There's like 20+ samples. Here's a few:

Power Management

It's nice if your app knows the power status of the machine it's on and avoid doing crazy stuff if it's on batteries.

Power Management

You can get all sorts of great power-related info:

private void GetPowerSettings()
{
settings.PowerPersonality = PowerManager.PowerPersonality.ToString();
settings.PowerSource = PowerManager.PowerSource.ToString();
settings.BatteryPresent = PowerManager.IsBatteryPresent;
settings.UpsPresent = PowerManager.IsUpsPresent;
settings.MonitorOn = PowerManager.IsMonitorOn;
settings.MonitorRequired = PowerManager.MonitorRequired;

if (PowerManager.IsBatteryPresent)
{
settings.BatteryShortTerm = PowerManager.IsBatteryShortTerm;
settings.BatteryLifePercent = PowerManager.BatteryLifePercent;

BatteryState batteryState = PowerManager.GetCurrentBatteryState();

string batteryStateStr = string.Format(
"ACOnline: {1}{0}Max Charge: {2} mWh{0}Current Charge: {3} mWh{0}Discharge Rate: {4} {0}Estimated Time Remaining: {5}{0}Suggested Critical Battery Charge: {6} mWh{0}Suggested Battery Warning Charge: {7} mWh{0}",
Environment.NewLine,
batteryState.ACOnline,
batteryState.MaxCharge,
batteryState.CurrentCharge,
batteryState.ACOnline == true ? "N/A" : batteryState.DischargeRate.ToString() + " mWh",
batteryState.ACOnline == true ? "N/A" : batteryState.EstimatedTimeRemaining.ToString(),
batteryState.SuggestedCriticalBatteryCharge,
batteryState.SuggestedBatteryWarningCharge
);

settings.BatteryState = batteryStateStr;
}
}

There's also lots of power-related events you can be notified of:

PowerManager.IsMonitorOnChanged += new EventHandler(MonitorOnChanged);
PowerManager.PowerPersonalityChanged += new EventHandler(
PowerPersonalityChanged);
PowerManager.PowerSourceChanged += new EventHandler(PowerSourceChanged);
if (PowerManager.IsBatteryPresent)
{
PowerManager.BatteryLifePercentChanged += new EventHandler(BatteryLifePercentChanged);

// Set the label for the battery life
SetLabelButtonStatus(batteryLifePercentLabel, string.Format("{0}%", PowerManager.BatteryLifePercent.ToString()));
}

PowerManager.SystemBusyChanged += new EventHandler(SystemBusyChanged);

Stock Icons

A lot of folks don't realize that there's a pile of stock icons that are available in Windows and you can access them programmatically.

image 

That means if you need the stock icon for a BluRayRom or a ZipFile, you can just ask for it.

Task Bar Progress

One of the nicest subtle features of Win7 is that if you've got a Progress Bar doing something in your application you can make its progress known in the Taskbar icon itself. This is fantastic for long-running processes like file copies, etc.

Notice the progress bar in this application and the taskbar button in the bottom right reflects it.

image

There's also icon/image overlays and other nice touches. Even better, this is epic-easy:

// When the user changes the trackBar value,
// update the progress bar in our UI as well as Taskbar
progressBar1.Value = trackBar1.Value;

TaskbarManager.Instance.SetProgressValue(trackBar1.Value, 100);

Since your app can have multiple progress bars, you have to manually decide what you want the taskbar progress to look like.

Core Helpers

Finally there's some nice "CoreHelpers" to make your applications easy to read and run on XP, Vista and Win7 at the same time:

//example
if (CoreHelpers.RunningOnXP()) { ... }
//example
if (CoreHelpers.ThrowifNotWin7() { ... }
// and all the others you'd expect for XP, Vista, Win7

I've just touched the surface of these samples. If you're doing Windowe Client development be sure to check out http://windowsclient.net/ and http://www.msdn.com/windows for more and start writing your application for the https://www.code7contest.com.

1. Get Windows 7 and the SDK

2. Develop and Test Your Application

3. Get the Windows 7 Logo

4. Light Up Your Application with Windows 7

Related Links

* Note the (lightweight) parameter I passed into this MSDN URL. Check out the new "Lightweight" MSDN Library and give the team feedback on the site!



Windows 7 Logo I've been tweeting about Windows 7 lately but I had a flash tonight that I should write some of this stuff down. Here's my list of the Top 10 Things Working Developers Should Know about Windows 7. I say "working developers" because if you're a .NET developer you either have run into these questions or you will, so why not put them in one place.

These are in no particular order. Also, in case it's not clear, each heading here is a link.

Windows 7 includes .NET 3.5SP1

If you're developing apps for Windows using .NET you'll be happy to hear that Windows 7 comes with .NET 3.5SP1 already installed. It's in the box, so one less thing to install for you.

Visual Studio 2008 works great on Windows 7

Have no fear. I run VS2008SP1 all day long on my Windows 7 machines (4 of them now) and it works fine*. Remember also that even though you're running Windows 7 and .NET 3.5 SP1, you can still compile for and target .NET 2.0 and Windows Vista or Windows XP clients.

You can write a single app for XP, Vista and Windows 7

...and that single EXE can "light up" on the newer OS's. I'm going to blog more about this soon, but there's a great Reference App called "PhotoView" (yes, I know, another photo app, but at least it's not Northwind). The point is that this managed WPF application runs nicely on XP, but if you run it on Vista you get Windows Search and UAC, and if you run it in Windows 7 you get Taskbar Integration, Transactional File System, Libraries, etc. One app on three Windows, working well and looking nice on all of them.

You can code to Windows 7 features today using the .NET Framework

There's a great Windows API Code Pack for the .NET Framework that's a library of source code that lets .NET folks access these new features even though they're not baked into the framework. That means .NET 3.5 SP1 developers can be writing Windows 7 apps today. This includes all the new shell features, search, the new Explorer Browser, new Dialogs and controls, and hundreds of new APIs. Check out the Windows 7 Developer Guide as well. Also, if that's not enough details there's dozens and dozens of new Win32 Samples and articles to go with them in the newly released and plainly named Windows SDK for Windows 7 and .NET Framework 3.5 SP1.

PowerShell is built-into Windows 7

You don't need to wonder if a machine has PowerShell. If it's running Windows 7, it's there and it's PowerShell 2.0. This not only means you can use PowerShell Scripts to automate things in your development process, but you can also use the PowerShell scripting engine in your apps without installing anything extra.

There's an extensive Windows 7 UX Guide

 Also available as a PDF, this guide helps you design your User Experience such that it fits into Windows 7 seamlessly. This includes guides for resolution, DPIs, windows sizing, alignment and control spacing. There's a great section on aesthetics as well.

There are Free Book Chapters for Upcoming Windows 7 Books

There will no doubt be a flood of Windows 7-specific books coming out soon. For now, there's a bunch of free chapters for "Windows 7 Inside Out," "Windows 7 Resource Kit" and "Windows 7 for Developers" that you can download now in PDF or XPS.

Windows 7 Training Kit for Developers

This is a nice rolled-up download of presentations, hands-on-labs and demos. It's got examples on how to use  new Windows 7 features like the Taskbar, Libraries, Multi-Touch, Sensors/Location, Ribbon Controls, and more.

There's a new "Windows on Channel 9" Site

This is a whole new section of Channel9 on MSDN that's dedicated to Windows 7 content. There are dozens of great videos, in-depth interviews with folks like Larry Osterman (the guy that makes Windows go beep) and Mark Russinovich. There's a Programming Windows 7 area with video deep drives on the new Sensor and Location Platform, Multi-Touch, Animation, and the new Graphics Architecture.

Boot to VHD Saves You Time

I'm going to beat this drum until everyone is booting to VHD. For my development machine, I'm running Windows 7 and VS2008 on my C: drive, but I sometimes boot into a Windows 7 and VS2010 Beta running on a VHD. Not a VM, no, they're too slow for me, but the Hard Drive is virtualized on the VHD. It's a nice way to keep crazy (or old) stuff in a separate place without fear of messing up partitions or my main machine! Here's a video demonstration and how to turn your Windows 7 media into a VHD ready for booting.

Did I miss anything?

Related Links

* If you install SQL2008, you'll get a compatibility warning during install. Keep installing, then just get SQL2008 SP1 and you'll be all set on Windows 7.



Windows 7 Easy Upgrade Path Truth Table/Chart

Posted 2009-08-07 12:50 PM in Win7.

Ed Bott's alternative Windows 7 Upgrade Chart Wow, everyone is moving up to Windows 7. I'm looking forward, as IT Manager for the Hanselman Family, to upgrading everyone. New OS for all the cousins and uncles and what-not is always a highlight of my year.

Personally, I think Windows 7 is a good time to do a "clean" install. Most people have decent internet speeds and there's just nothing quite like the fresh minty smell of a new install.

Disclaimer: I don't work for the Windows team and I wrote this post in the dead of night completely off the clock on a PalmPilot so there might be no confusion about my motives. I'm just a techie dude who happens to work for the Big Blue Monster. This is not official anything and it's a blog. It's very likely wrong or complete nonsense. One day you'll show up and I'll have been fired, drawn and quartered and this site will be all 404s. That is all. I may start selling T-shirts containing my disclaimers in case they are in any way unclear.

There's a few choices for you:

Clean Install + Migrate: You can certainly "migrate" your settings from an old machine to a new one still doing a clean install. It's a clean install, but you're saving time by bringing lots of little things over like browser history, favorites, usernames, passwords, subtle settings. Either way, you've got choices.

In-Place Upgrade: You can also "upgrade in-place," meaning you're installing Windows 7 to c:\windows (or whatever) and it'll upgrading your Vista installation directly. Once Windows 7 is installed, you can do an "Anytime Upgrade," for example, taking Win 7 Home Premium to Win 7 Pro if you like.

There's a chart that explains this, but visually, it's too complex in my opinion. I stated working on a simpler one, then Ed Bott in his wisdom beat me to it. It's a truth table of sorts, and technical folks LOVE to collapse their tables. What may have made sense to the original designer is begging for refactoring by one of us.

The original table looks scary and sends a negative message. However, as Ed points out "Most Vista users will have clear and logical upgrade paths from their current edition to the same edition of Windows 7."

Basically, if you're going from whatever version of Vista you have to a similar (or greater) version of Windows 7, you're all set. You'll only need to clean install if you're going from a "high sku" to a lower one. Go check out Ed's chart or click on the image above and enjoy your upgrade!



Previous Page Page 3 of 5 in the Win7 category Next Page