"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.

Challenge: 24 processes and 378MB. Possible?

Sun, January 14, 2007, 05:29 PM under Random
For the UK launch of Vista and Office, I am doing a Vista session as expected, but I am also filling a "SharePoint Workflow and collaboration" slot. To prepare for the talk I am running a Virtual PC image of Windows Server 2003 with MOSS on my Vista machine. When I received this image, immediately the challenge was obvious: the VPC image requires 2GB of RAM and my laptop has a total of 2GB of RAM. I lowered the RAM requirement of the image but it would still not start due to lack of memory. I was convinced that I could lower the memory requirements a little and also kill everything unnecessary on my Vista laptop so the host OS used as little memory as possible.

Question: Is there something I can do to a host OS to run the bare minimum since all I am going to be doing is running the VPC and nothing else? No connectivity, sound or anything else required; all I want the machine for is to run full screen the VPC image. Please let me know.

So my steps to minimising RAM use by the host OS was what most people would think:
1. Exit all applications via the X in the top right corner of their window.
2. Right click on all systray icons and select “Exit” (if they offer that option)
3. Run Task Manager. The Applications tab is empty (like the taskbar). Go to the "Processes" tab.
4. Select each unnecessary process and then click the "End Process" button in the bottom right.

At the previous stage you can cause damage so I explicitly do not advise that you kill processes that are not yours. The next stage is even more dangerous so please do not do that.

5. Click on the "Show processes from all users" button. Now you have a whole bunch of more processes to kill. Go to town.
6. After killing more processes than you've ever killed in your life, next let's stop some services. Go to the "Services" tab of Task Manager.
7. For any running service that you think is unnecessary, right click and choose "Stop service".

At the previous step you really are taking your life in your own hands. Only an idiot would stop services they know nothing about so please let me be the only one.

I have gone through this exercise a few times and once I managed to blue screen the machine and another time it just decided to restart with no warning other than slowly dimming the screen to black. I cannot stress enough that the above actions can cause loss of data or permanent failure.

8. My penultimate tip (the last one is at the end in the post script): before doing all of the above make sure you turn off network connectivity since some of the things we are killing result in a less secure machine and also many of the services we are stopping are network related.

Now you know why I asked the question earlier. I know there is a better way to eliminate all unnecessary running processes, but I don't know exactly what it is. This painful process is something I repeat every day since Christmas but at least now I know what to kill and what is either unkillable or comes back to life or if it dies it takes the system with it. It is still irritating having to do all that so please put me out of my misery and tell me how to run a VPC image that uses almost all the RAM of the host machine.

In any case, here is what the "Performance" tab of my "Task Manager" shows after I am done killing:

That's right folks, a Vista machine running with only 395MB and 24 processes. Beat that if you can!! See your task manager right now for how many processes you are running.

I then launch my Virtual PC with the gigantic image, and 12 minutes later the image is loaded and the picture has changed to this:

Yup, 1.72GB used up immediately! Not that life is good from here on cause I have lowered the VPC image's RAM to the extent where it is very slooow regardless... with the occasional failure to render the navigation bar of the SharePoint site.

I can even manage to get the RAM usage down to 378MB as this screenshot proves, which is about half of what I'd normally use when VPC images are not in the picture.

So what do you think: the next time I am asked to do a session that requires a VPC image this big, should I ask for a new laptop to go with it? ;-)

PS The biggest RAM savings I got were by stopping the services “SuperFetch” (trade memory for perf) and “Windows Search” (trade memory for productivity). Getting down to 24 processes included killing “explorer” itself (and launching the VPC image from Task Manager). These 3 actions, plus turning off aero (i.e. no glass) saved me ~150MB.

My WEI score

Sat, January 13, 2007, 09:21 PM under Random
My pathetic WEI (aka WinSAT) is available here where you can also share yours.

iPhone

Tue, January 9, 2007, 06:16 PM under Random
Just followed some links from Loke's blog

It is one cool mother but...

1. Work out how much it will set you back after taking the farcical price tag and adding the rates for data and voice! Who will afford that?

2. No high speed internet access (probably so it doesn’t hurt its already bad battery life)

3. No sync with exchange! That rules out most business users.

4. No physical buttons at all?! I like feedback at my fingertips when answering the phone or sending a txt msg.

5. V1 product to be available in Europe in 11 months.

...but it is sexy... very nice toy indeed!

PS If you are reading this far it means that you didn't work out the cost, did you? ;-)

SideShow devices

Mon, January 8, 2007, 10:14 AM under Windows | Vista | SideShow
Just before leaving for CES, Dan Polivy recorded a short video for on10 showing off 8 SideShow-compatible devices: Asus laptop, LG Z1-p laptop, credit card companion device, remote controls from 3 different manufacturers and Logitech keyboard & speakers!

As always with cool gadgets words are not enough so check out the video and drool :-)

I wonder if the guy behind SideShowDevices will be posting pictures of all these soon...

UPDATE: Also spotted at CES, wearable SideShow device (thanks Keeron Modi for the heads up).

Free copies of Vista and Office

Mon, January 8, 2007, 04:09 AM under Events
Remember the Office and Vista launch I mentioned? Preparing for that has my undivided focus for the next 11 days.

While physical attendance is now sold out, anyone can still participate online; UK residents that do participate online have a chance of winning free copies of Vista and Office! More details on Ian’s blog.

Best of "The Moth" 2006

Mon, January 1, 2007, 06:56 AM under dotNET | MobileAndEmbedded | Windows | Vista | Links
Exactly two years ago on New Year's day, I wrote the Best of "The Moth" 2004 blog enrty where I picked my favorite blog entries out of 96 posts. Exactly one year ago I had to choose from 151 posts to find the ones I thought were the best in terms of content and the result was the Best of "The Moth" 2005.

The year of 2006 I made 142 blog entries and below are a select few. Happy New Year!

01. I didn't have a chance to play with it as much as I wanted to, but with very little public info available, this blog served it well: .NET Micro Framework, its product sheet and other NETMF links.

02. Recognising an idiom of the using statement.

03. A cute desktop feature implemented for the Windows Mobile/WinCE platform in a reusable NETCF control: TextBox cue banner.

04. A picture is worth a 100 words and a video is... a whole bunch of pictures! Check mine out following the instructions here for my nuggets.

05. A comprehensive collection of links for Windows Workflow Foundation (WF).

06. I collected the links to my 9 blog posts on sharing assets between desktop and mobile platforms in one place. Follow the numbered links.

07. The most controversial feature of Windows Vista is something every developer must understand: User Account Control.

08. One of Vista's features is becoming my obsession and that is SideShow. My series of SideShow gadgets blog posts will continue in 2007 and so far you can read parts one, two, three, four and five.

09. I spent 6 months last year focusing almost entirely on Vista developer features that are new and that are *not* part of NetFx3. I have catalogued my blogging & screencasting efforts in a large collection of links to content that supports my speaking engagements on Vista. IMO this blog post alone could have been the best of "The Moth" this year:
Vista-only features for the managed developer.
Stay tuned in 2007 via one of the subscribe options on the left :-)