Brad Wardell's Blog
Interview at FileFront
Samurize 1.61 released
Aero-related content
Aero-Soft.com
For those of you who are interested in customizing Windows XP to look like the next generation version of Longhorn or simply want the latest news and information on Microsoft's next generation version of Windows, be sure to visit www.aero-soft.com.
What is Avalon
Avalon is the new rendering and compositing technolgoy that Microsoft is developing primarily for Longhorn (Microsoft's next release of Windows) that is available in beta form on Windows XP as I write this.
From Windows 3.0 all the way through Windows XP, the Windows graphical environment was pretty primitive. The Graphical Device Interface (GDI) provided only limited visual options to developers.
As 3D hardware has improved, the gulf between what developers could do with traditional Windows programs versus what one could see in a PC game grew more and more obvious.
Avalon is designed to bridge that gap. It provides two things of particular interest:
(1) It delivers a new rendering and compositing model that developers can take advantage of. This new model can make use of the latest/greatest advances in video hardware (such as 3D). That doesn't mean one must use it to create "3D" looking programs but rather it means that all kinds of impressive visual effects become possible.
(2) It provides a new programming model that allows software developers to create user interfaces that are defined declaratively (such as created via XAML).
(Editorial on)
Everything else you hear about Longhorn is mostly just fluff. It's really about Avalon. Without Avalon, there's not much point to Longhorn in my view.
The reason for that is not because people want eye candy but because we are currently moving towards a video stand-still.
Consider this, modern LCD displays can display at 1600x1200. But many people don't bother to run at the highest resolution their monitor can display because "everything gets too small". That's because fonts and other elements in Windows are at a static DPI (96 dpi to be precise).
Avalon's compositer allows you to use the full potential of your display. Increase your resolution as much as you can and then adjust the size of everything on the fly. Instead of bitmaps and hard coded font sizes, you have vector based interfaces that simply become more detailed, more defined as you increase the DPI. Same for fonts.
So the user running at say 3200 x 2400 in 2008 isn't greeted with tiny text and tiny UI. Their UI is whatever size that is comfortable for the user with it being sharp and detailed (Rather than scaled up with fuzzyness).
The compositing engine will allow for far for interesting ways to display information on the screen. Right now, developers are limited in how they can display things on screen by the graphics sub-system. When people saw the Dock on MacOS X with its "genie" effect, PC users oohed and awed. That sort of thing is just the tip of the iceberg. That's just eye candy.
With XAML, developers will be able to put together sophisticated, visually appealing programs quickly and easily that tap into Avalon. This could create user interfaces that are designed to meet the user's needs much more easily than what we have today.
(editorial mode off)
What is WinFS
Instead, it's a SQL based layer that sits on top of NTFS. Simply put, NTFS is a terrific file system. But what it needs is a modern, state of the art way for people to organize their programs and data so that users aren't having to dig through gigabytes of data to find things.
It turns your local hard drives into one big SQL database (okay, that's a bit of an oversimplification but you get the idea). And if you have Microsoft's server on that has WinFS support, you could potentially be able to find data quickly across your enterprise.
WinFS is not currently available but is scheduled to be released sometime after Longhorn and be available for Windows XP as well.
WinFS will be on Windows XP after all
While no one knows for sure when, how, and if Microsoft's next generation file system technology will manifest itself, Microsoft officials do plan to bring WinFS in some form to Windows XP.
Just as Microsoft is currently doing with it's next-gen display technology, Avalon, WinFS apparently will be able to be used by Windows XP users as well.
DesktopX 3 Tutorial available - creating a widget
DesktopX 3: Creating a widget
Creating widgets with DesktopX 3 is, relatively speaking, a snap. Today I'm going to walk you through how to create a widget. It's actually going to be a pretty complicated one (for me anyway) but it will hopefully show you the ropes on how to create fully featured widget.
The widget I want to create is one I've been looking for for a long while - A disk space meter that lets the user configure which drive they are monitoring.
Step 1: Load up the DesktopX development environment.
This is the last option on the DesktopX Standard "Welcome" screen.
Once you had loaded it, you will be created with this dialog:

At this point, depending on your skill-level you're going to either want to import an existing widget (which is what I'm going to do because I need to have a sample in front of me) or you'll jump right in to making the widget.
Step 2: Import existing widget or create one from scratch.
Since my widget is going to be getting the amount of disk space available from a particular drive, I will want to look at a similar widget that gets the amount of free memory available. There is a sample included with DesktopX 3 that does this. So I'm going to click on the "Import a widget" button.
If I had wanted to create from scratch, I would have clicked on the "Desktop" tab in the builder dialog and chosen "New" object and started from scratch.
The widget in question is called the WM-Memory_meter widget. All it does is display the amount of free memory. It's very simple. But the reason I need it is that I don't personally know how to get system information like this via VB Script or JavaScript.
So now I'm going to right-click on it and choose Edit Script.
Step 3: Write your script.
| 'Let's allocate the object globally, so we don't waste time allocating it on each call Dim objWMIService Sub Object_OnScriptEnter object.settimer 123, 5000 Set objWMIService = GetObject("winmgmts:\\.\root\cimv2") Object_OnTimer123 End Sub 'Let's clean it, as a good practice |
So there's the whole thing. When it starts, it created a timer called "123" that gets called every 5,000ms (5 seconds). He's accessing the WMI stuff (which I'm not that familiar with). And on the Timer, he's grabbing specific stuff from the WMI object.
So okay, how do I use this to get % of disk space available. My answer: Google. I am going to look for "Win32_PerfFormattedData_PerfOS_Memory" in Google and see what other goodies are available. And I found this page. And boy are there a lot of different things you can display. But I find the one I want: "Win32_PerfFormattedData_PerfDisk_LogicalDisk".
But there's a bit more I need. The memory thingy in the example doesn't have to grab from a particular drive. I need a way to get the disk space free on a particular drive. That leads me back to Google where I start trying in searches to with my newly found term with drive letters and such. I find this page. It doesn't have what I have but you may find it useful for other things. I eventually make it to this page here. And then I find this gold mine! Holy cow, there are so many things I could make with this one page. Okay, one thing at a time..
I make this change in code:
| Sub Object_OnTimer123 Dim colItems Set colItems = objWMIService.ExecQuery("Select * from Win32_PerfFormattedData_PerfDisk_LogicalDisk where Name = 'C:'",,48) For Each objItem In colItems Object.text = "Available space: " & objItem.FreeMegabytes & " MB" Exit Sub Next End Sub |
But there's a whole bunch of things I could have instead of .FreeMegabytes. That page has tons of things (including free space). If I want to display the percentage of free space available, I'd use PercentFreeSpace instead of FreeMegabytes.
It took a bit to figure out that I simply had to plugin 'C:' as the name of the drive in the query. But once I figured that out I was ready for the next step.
Step 4: The Preferences Dialog
What sets this widget apart from others is that you can set which drive you're monitoring the disk space for. To do that, I will need to build a preferences dialog. So I look in the "DX Scripting Guide" that comes with DesktopX and chapter 8 is "Widget Preferences".
There is only one simple rule with creating preferences -- they have to be the very first thing you do in your script or else they won't be created. All I want to do is create a simple combo box where the user selects the drive letter.
Therefore: I need to add these lines right after the Object_OnScriptEnter:
| Sub Object_OnScriptEnter Widget.AddPreference "Combolist1" Widget.Preference("Combolist1").Type = "ComboList" Widget.Preference("Combolist1").AddValue "C:" Widget.Preference("Combolist1").AddValue "D:" Widget.Preference("Combolist1").AddValue "E:" Widget.Preference("Combolist1").AddValue "F:" Widget.Preference("Combolist1").AddValue "G:" Widget.Preference("Combolist1").DefaultValue = "C:" Widget.Preference("Combolist1").Caption = "Available Drives" Widget.Preference("Combolist1").Description = "Disk Drives" object.settimer 123, 5000 Set objWMIService = GetObject("winmgmts:\\.\root\cimv2") End Sub |
The current value of the combo box is known as Widget.Preference("Combolist1").value. So I go back to that other function where I had hard coded 'C:' and change it to:
| Set colItems = objWMIService.ExecQuery("Select * from Win32_PerfFormattedData_PerfDisk_LogicalDisk where Name = '" & Widget.Preference("Combolist1").Value &"'",,48) |
The other thing we will want to add is to have it recheck when the user closes the preferences dialog (after changing the drive letter). This is from the docs.
| Sub Widget_OnPreferencesChange Object_OnTimer123 End Sub |
At this point on our screen we have:
![]()
Step 5: Export the object as a widget.
Now it's time to export it as a widget. To do that, right click on it and choose "Export".
If you have DesktopX Pro, you can export this as a "gadget" which turns it into a stand-alone program you can send to anyone.
And here we go:

My widget is ready to go.
Here is the full source code:
| 'Let's allocate the object globally, so we don't waste time allocating it on each call Dim objWMIService Dim szDrive Sub Object_OnScriptEnter Widget.AddPreference "Combolist1" Widget.Preference("Combolist1").Type = "ComboList" Widget.Preference("Combolist1").AddValue "C:" Widget.Preference("Combolist1").AddValue "D:" Widget.Preference("Combolist1").AddValue "E:" Widget.Preference("Combolist1").AddValue "F:" Widget.Preference("Combolist1").AddValue "G:" Widget.Preference("Combolist1").DefaultValue = "C:" Widget.Preference("Combolist1").Caption = "Available Drives" Widget.Preference("Combolist1").Description = "Disk Drives" 'If I wasn't so lame I'd write something that would go through the list of drives available and make sure only available drives are here but I'm too lazy for that. object.settimer 123,5000 |
Some other notes
A few observations worth noting. DesktopX isn't cross-platform. On a widget enabling program such as this, this should be considered a feature not a limitation. Because DesktopX is designed exclusively for Microsoft Windows (or 98% of the market) it is able to support all kinds of things that a cross platform program would not. For instance, this example relied on the WMI Service of Windows. There are tons of things of this nature that are specific to Windows that can be created that wouldn't be practical if it were cross-platform since different platforms have different features and limitations.
You can learn more about DesktopX 3 at http://www.desktopx.net. It comes in 3 forms: DesktopX Client (a run-time to make use of objects, widgets, and desktops). DesktopX Standard which is what would be the least you'd need for this example (and comes with Stardock's mega OS enhancement suite, Object Desktop), or DesktopX Pro which allows you to export these widgets as "gadgets" that can be sent to anyone whether they have DesktopX or not.