"Orcas"

Wed, January 31, 2007, 03:35 PM under dotNET | Orcas | VisualStudio
This blog will get an additional focus over the coming months: "Orcas" :-)

Before Visual Studio 2005, .NET Framework v2.0, C#2, VB8 and CLR v2.0 shipped, they collectively had the code name "Whidbey".

As we know, recently the .NET Framework v3.0 shipped, which leaves intact the languages, CLR and existing Framework bits. It also continues to take advantage of the same VS2005 albeit with WF extensions (and no released tool bits for WPF & WCF).

Next, we are going to see an update to the Framework bits (v3.5), languages (C#3, VB9) and Visual Studio; collectively the update has the codename "Orcas". I will label/tag such topics as 'Orcas'. The "Orcas" release also includes a new version of the .NET Compact Framework (v3.5) along with new integrated Visual Studio for Devices enhancements. I will continue to tag/label those topics as 'Mobile and Embedded'.

Until now I’ve refrained from diving into "Orcas" for various reasons. I can tell you that even though the documentation doesn’t list Windows Vista as supported, I finally have the "Orcas" January CTP running fine on Vista both in VPC 2007 and directly installed. Stay tuned :-)

More Preview Handlers

Tue, January 30, 2007, 05:27 PM under Windows | Vista
Remember the awesome Managed Preview Handler Framework for Vista and Outlook? Visit the author’s blog to download a Preview Handler Association editor.

I also found a preview handler, written with the framework, which is for code file extensions such as .cs, .vb, .js and .sql (link to download here).

Given that the visual effect is best described with a video, I’ve recorded a screencast on the topic.

After recording the video I came up with a slightly more useful preview handler than the one I showed there. How many times have you wanted to quickly extract the FullName or specifically the PublicKeyToken from a strong-named assembly? So I thought I’d write a managed preview handler that works for managed DLLs and shows some quick info when you select the file in explorer as the following screenshot shows:


Like the demo preview handler shown in the screencast, only one method has real code and I am sure you can imagine what it looks like... and if not, get it here (demoware).

...and remember that preview handlers also work in Outlook 2007... I guess that is what they mean when they say "better together" ;-)

Windows Vista Ultimate Extras

Tue, January 30, 2007, 03:19 AM under Windows | Vista
With Windows Vista now available for everyone, 2-3 downloads are available for those running the Ultimate edition (as well as some other updates for everyone :-)).

This is what my Windows Update screen looked like today:

The “Wow” starts now

Mon, January 29, 2007, 10:41 AM under Links
I love Microsoft marketing. Even though they mostly get it wrong IMO when naming Microsoft developer products/technologies, you’ve got to give it to them when it comes to catchy phrases. How can you not love:
The "Wow" starts now
Finally, all the stuff I’ve been talking about over the past 9 months, will be publicly available to everyone in about 5 hours!

Weirdest speaking venue ever!

Sat, January 27, 2007, 12:25 PM under Events
Was going to post this yesterday but with a 2-hour flight delay from Newcastle to Southampton and a 1 hour train delay from Southampton to Hove, the last thing I wanted to do when I got home was blog...

The roadtrip ended and overall it was a very positive experience and I would do it all over again given the opportunity (maybe with a slightly more upmarket accommodation than the Travelodges)! Mark has been capturing the trip’s journal on the official blog so check out the photos of Day 1, Day 2 morning and afternoon, Day 2 evening, Day 3, Day 4, Day 4 and 5.

The venue that stuck out compared to the rest in terms of its bizarreness was the event in Coventry. The crazy NxtGenUG people decided to host the event in an old airplane! From a temperature perspective it was practically like presenting outdoors in minus degrees Celsius. I have never done a presentation in my woolly hat and gloves before but I guess there is always the first time! Laugh at the photos on the NxtGenUG site.

UK Vista and Office Launch Tour Roadtrip

Fri, January 19, 2007, 07:12 AM under Events
Today I am doing a couple of sessions for the UK launch of Office and Vista at TVP, tonight I’ll be at the launch geek dinner and tomorrow I’ll be helping out at the hands-on labs at Day 2 of the launch. BTW, you can all participate online as well where recorded versions of our sessions are already waiting!

Next week, Mon-Fri, we are going on the road to follow up on the promise I made a while back. We are doing countless events stretching from Southampton to Newcastle in a car. It is only 4 out of 5 from the team on the roadtrip, as the fifth member has bigger issues that he needs your help with!

To follow the trip in a virtual way stay tuned on that feed... More from me back here in a week!

SideShow designer: ISV opportunity

Thu, January 18, 2007, 04:20 AM under Windows | Vista | SideShow
I am really pleased that Scott is jumping on the SideShow train :-)

Windows SideShow provides an opportunity for every manufacturer that has a device with a screen on it to SideShow-enable it. It also provides an opportunity for all application developers to extend the reach of their application by either directly calling the SideShow API from their existing app to send content to SideShow-compatible displays, or to write a new non-UI process (a SideShow gadget) that sends the content.

There is another opportunity here for ISVs. Provide a graphical designer for generating SCF, which application developers can then easily send down to the devices. Crafting SCF by hand or using the managed API’s Scf class is trivial but still not as smooth as using a graphical designer (a bit like designing Windows Forms without the designer or even closer a bit like crafting XAML by hand without "Sparkle"/"Cider").

So what are you waiting for? The schema is there, the elements (think controls) have only a few attributes (think properties) and there can only be a single element/control per row/line... show me what you can do!

UPDATE: The Microsoft.SideShow.dll (written by Jeffrey Richter) that I have been using in all my posts is now publicly available. Details here :-)

TreeViewVista

Wed, January 17, 2007, 05:28 PM under Windows | Vista
In an older post I highlighted one of the changes in the TreeView control in Vista’s explorer:
"...the treeview has no horizontal scrollbar at the bottom and scrolling happens for you automatically as you select nodes that are not fully visible and as you mouse over around..."
I then offered some code that makes the System.Windows.Forms.TreeView control behave the same way.

If you take a further look at the explorer TreeView you’ll notice that in addition to the autoscroll functionality previously described, there are also some aesthetic changes:
1. The selected TreeNode has a highlight rectangle but it is not the heavy blue that it was on legacy versions of Windows.
2. When hovering over non-selected TreeNodes, the node under the mouse also gets a very light blue rectangle.
3. Rather than ‘plus’ and ‘minus’ signs before each node (used for expanding/collapsing) it has some small triangles (filled with black, empty or highlighted with blue).

E.g. in the following picture the “inetpub” folder is highlighted while my mouse is over the “logs” folder:


So I was looking at how I can make my managed TreeView have the same feel and look. The answer is in the Vista MSDN forums: you have to call SetWindowTheme API from the uxtheme.dll as follows:
SetWindowTheme(treeView1.Handle, "explorer", null);

As an aside, you can use this exact code with the ListView control as well :-)

Note that for the managed TreeView you also have to set to true the HotTracking property (and for identical look, to false the ShowLines property).

So, next thing I noticed is that the explorer TreeView also auto hides the +/- replacements i.e. it auto hides the little triangles. It was easier finding out how to achieve that since I had already seen a list of new Vista TreeView constants which is where the inspiration for the blog entry on TVS_EX_AUTOHSCROLL came from. The answer is to add to the TreeView's extended style the TVS_EX_FADEINOUTEXPANDOS:
NativeMethods.SendMessage(treeView1.Handle,
NativeMethods.TVM_SETEXTENDEDSTYLE, 0,
NativeMethods.TVS_EX_FADEINOUTEXPANDOS);
...of course to add the style rather than just set it, first you have to retrieve the existing style and then bitwise OR it with the TVS_EX_FADEINOUTEXPANDOS style.

I have updated the two code files, which I posted last time, to incorporate these additions and you can get them from the same place: NativeMethods.cs and TreeViewVista.cs (the comments in the code are self-explanatory I hope).

Finally, note that you can pick and choose which feature you want. For example Windows Mail on Vista clearly sets the “explorer” theme (and HotTracking=true and ShowLines=false), but does not set the extended styles at all (so no auto-fading and no auto-scrolling)...

Windows Mobile Managed APIs

Tue, January 16, 2007, 09:47 AM under MobileAndEmbedded
A very long time ago I blogged a bit about the Windows Mobile 5.0 managed APIs (also see this).

Recently I also described how to work around installing the free WM5.0 SDK on Windows Vista.

With v5.0 now being the de facto standard of Windows Mobile devices out there and given that the next version of Windows Mobile fully supports these APIs, it is never too late to jump in and learn how to use them and what they are about. In December I wrote a short article for the msdn flash on this very topic (subscribe to the flash now if you don’t already!).

So, if you want to learn more about the WM v5.0/vNext managed APIs or need more proof that mobile development works fine on Vista, download my 3-part nugget, which I hinted at in the article:

Part 1: Configuration, Telephony and Forms [streaming file and zip download]

Part 2: Status [streaming file and zip download]

Part 3: PocketOutlook [streaming file and zip download]

Note: The first 2-3 minutes of all videos is the same introduction. The last 1-2 minutes of all videos is the same summary and links. The 17-19 minutes in between is the demo bit, different in each part of course.

A few links I've been meaning to share

Mon, January 15, 2007, 10:53 AM under Links
- Tim's insightful commentary on why Vista's cosmetic changes aren't just that.

- Came across an interesting article on 'Quantifying Complexity: .NET vs J2EE'. I read to my wife a quote from the article that I liked: "Beliefs without evidence are just bias [...]". She came out with a cheap shot but one that made me chuckle nonetheless: "What's your evidence for that?" :-). Anyway, read the article.

- And finally, all you wanted to know about why, when and how to use NativeMethods, SafeNativeMethods and UnsafeNativeMethods.