Brad Wardell's Blog
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.
Kapsules 0.9.8.40 released
http://kapsules.shellscape.org/wiki/ - The User Guide.
http://kapsules.shellscape.org/history.aspx - Version History and Change List.
DesktopX 3 Quick Tour
Quick recap: DesktopX is a program designed to extend Microsoft Windows to support additional content. By default, only one thing sits on your desktop - icons. DesktopX lets people add desktop objects (think "super icons"), widgets (mini-programs that sit on your desktop), or build entirely new desktops (.desktop) files.
DesktopX 3 is designed to make doing all this easier than ever and adds a ton of new features. Moreover, DesktopX Pro supports creating stand-alone programs called "gadgets". So now you can take your creations, export them as a gadget and give them to anyone running Windows 2000 or XP (and soon Longhorn).
Here's a quick tour of what DesktopX 3 brings..
The most obvious change will be immediate. This is the new DesktopX interface. Users will be able to pick what they want to do from the start.
For users who just want to run widgets, DesktopX 3 includes a simple system tray program that lets users manage their widgets. DesktopX widgets don't require any sort of "environment" to be already running (once DesktopX is installed you can just run widgets like programs). But this tiny program lets you manage your widgets really conveniently.

The second option is the "Load object" option. Desktop objects are similar to widgets except they all run together in a single environment saving memory. As a result, they are primarily used as "super icons".

(loading some desktop objects onto my desktop)
The third option, "Load Desktop" is for people who want to load an alternative desktop (like the one below).
So up to this point, these are the things you will be able to do with DesktopX Client (the $14.95 Run-Time). It also comes with Object Desktop.
But if you want to edit or create your own content, that's where DesktopX 3 Standard comes in ($24.95). That's where the 4th option comes: "Create".

The DesktopX Builder is the environment for creating objects, widgets, and desktops. It's also needed for modifying existing content. So unless all the content you download is exactly as you want it, you'll still want the standard version of DesktopX. DesktopX 3 Standard will also come with Object Desktop.
It is DesktopX Builder that users can create new objects and widgets and desktops that they can share with others.

Because DesktopX Builder is separate from the end user portions, it is a much simpler experience for the developer. They can focus purely on the development aspects. The settings they put in become part of the theme itself.
When a user is done, they can export an individual object (.dxpack), widget (.exe) , or an entire desktop (.desktop) for others to use.
And lastly, if you have DesktopX Pro, you get an additional export option: Export as a gadget.

Stardock will be launching DesktopGadgets.com this Spring to enable developers to submit their gadgets. The developer chooses the price they want to sell them at (or give them away for free) and once it passes moderation it becomes available with DesktopGadgets.com and the developer splitting the proceeds.
Now, all that you see here so far are just the user experience differences. There has been tons of code changes to DesktopX.
Here are some more highlights that long time DesktopX users can appreciate:
-
UI Threading. The biggest engine change is that DesktopX 3 scripts are synchronized with the user interface. That means when something is done in the script, DesktopX acts on it immediately. This eliminates the timing headaches many widget developers ran into and allows for real-time widget behaviors.
-
Centralized scripts. In DesktopX 2, each object that made up a widget had to have scripting associated with that particular object. That could make things quite complicated to developer. Developers can still choose to do this, but now developers can do the whole thing from a single script. That includes creating objects, deleting objects, handling callbacks for other objects, etc.
-
On-The-Fly states. DesktopX 3 allows for new states to be added to other objects from a remote script and be handled from that same remote script.
-
Custom Preference Dialogs. Developers can now add a preferences page to a widgets properties dialog for their own settings.
-
Third party DesktopX API extensions. Developers can create plugins that add new APIs that are accessible from scripts. So if there is some feature we didn't think of, developers can fill in those gaps. No other program of this type can do this.
-
New options for text handling (word-wrap for instance).
-
Clipboard control from script. This is actually a pretty big deal. Many "widgets" look neat but can't interact with the system clipboard. Now it'll be easy for developers to put clipboard support into their widgets.
-
API wrapping. Stardock is working to make all the relevant Windows APIs available via script. Not all of this will be in 3.0 but the start of it will be.
These things may sound a bit "techie" but they will allow for much far-reaching content. The goal of DesktopX 3 is to make widgets much more mainstream and to deliver widgets that are more than a collection of desktop toys. There are all kinds of very useful, innovative things waiting to be made but the widget enabling programs have to support them. DesktopX 3 will be the most powerful environment for this kind of thing.
We will also be working on the new .desktop format that will support better system tray support (through a new, improved MCP) and 64bit support as soon as we can.
DesktopX 3's home page is www.desktopx.net. Release date: March 15.
ObjectBar 2 will support DesktopX 3 widgets
ObjectBar 2, one of the key features of Stardock Object Desktop, has long been waiting for its major update. The next beta, due out just after DesktopX 3's release will natively support DesktopX 3 widgets as part of a ObjectBar bar.
This is significant because every other "bar" like program that's ever been made has been limited to either plugins or what features were built into it in terms of what it could display. When one thinks of all those various Longhorn bar type programs out there, one can imagine what becomes possible when widgets can be designed and made for a desktop bar.
It is much easier to create and customize a widget than it is to try to write some plugin or try to visually customize some element of a desktop bar program.
Stay tuned..

