Logo
September 26, 2006

A look into Vista

Filed under Development, Software at 9:13 pm  

Ever wondered how they do things inside of Microsoft? As a developer that makes extensive uses of Microsoft technologies and tools, I'm always interested in an insight into their development process. Well, if you're like me, then I may have a real treat for you.

Vinny Pasceri, the AERO Program Manager for Microsoft has posted an great insight on the (fairly new) Windows Client Team Blog. This is a great peak into what the design process looks like, and even includes what may be the first publicly released feature spec. This makes for a great read, I highly recommend taking a close look at this article and the included spec.

 

September 24, 2006

EventArgs: No need to pass a new Instance

Filed under Development, Software at 11:15 pm  

If you look at the code I write, seeing a line similar to the following would be fairly common:

RaiseEvent LoadComplete(Me, New EventArgs)

Yesterday, I wouldn't have given this a second thought, but today, the story is a bit different. A friend of mine pointed me to an interesting comment by David Kean (from Microsoft) on the MSDN Wiki indicating that the line above is actually wrong!

So, based on his comment, I should be using EventArgs.Empty instead of creating a new instance, something like this:

RaiseEvent LoadComplete(Me, EventArgs.Empty)

So using EventArgs.Empty must be better somehow, so I decided to take a look and see if I could figure out just what the difference would be. The MSDN states that "The value of Empty is a read-only instance of EventArgs equivalent to the result of calling the EventArgs constructor" - so what's the difference? Time for a trip into the Reflector.

The Reflector shows two constructors:

Public Sub New()
End Sub

Shared Sub New()
  EventArgs.Empty = New EventArgs
End Sub

So, EventArgs.Empty just calls New EventArgs and returns that. Right.

Anybody see something there that I'm missing? Seems to me that the somewhat more verbose, but more clear (as to what is actually happening) syntax would be better, and no less efficient. If anybody has an opinion about why you would do one instead of the other, I'd like to hear it.

September 23, 2006

Make XP Pretty

Filed under Software at 5:33 pm  

While going through my (long) list of RSS-feeds that I monitor, I found this gem of an article: Vista Transformation Pack: Vista-ize your XP. The Vista Transformation Pack is a clever little application that moves your XP desktop several steps closer to the beauty that is Vista. While the 'transformation' doesn't give you all of the new UI goodies that come with Vista, it does add a fair bit of eye candy.

I'm not typically one to promote UI tweaks like this, but after playing with the settings, I've now have a great looking setup without the instability that still goes with Vista.

 

September 20, 2006

VB.NET 2005 Interop Toolkit

Filed under Development, Software at 10:33 pm  

The VB Team has just announced the release of a VB.NET / VB6 Interop toolkit, complete with source. For those of us that work in shops that still maintain a fair number of legacy applications, this could be quite useful. Here's the description straight from Microsoft:

The Interop Forms Toolkit 1.0 is a free add-in that simplifies the process of displaying .NET WinForms in a Visual Basic 6 application. Instead of upgrading the entire code base, these applications can now be extended one form at a time. The goal is a phased upgrade, with production releases at the end of each iteration containing both Visual Basic 6 and Visual Basic .NET forms running in the same Visual Basic 6 process. 

My favorite thing about this release is the inclusion of the source code* - I always love taking a peak at how MS writes code. As a side note to all this, this is just one part of the new Visual Basic 2005 Power Pack, a collection of controls, components and add-ins - all free. This is one worth looking at.

* Note: You'll find the source if you take a look in the "X:\Program Files\Microsoft Visual Basic 2005 Power Packs\Interop Forms Toolkit 1.0\SDK\Source" folder. 

 

September 17, 2006

Running RegEdit as SYSTEM

Filed under Development at 7:59 pm  

While facing an interesting research challenge, digging into the inner working of Windows, I realized that I needed to change a registry value. That's simple enough, I fire up RegEdit, make the change, then politely as RegEdit knows how, it told me that I couldn't change the value! Being one that hates when my computer tells me I can't do something, I had to find another option. 

So after some research, I found my answer: sc. This is a great little utility (included with Windows), and made the task of running an application as SYSTEM* much easier. At this point some of you may be wondering why I didn't just use RunAs instead, as it's designed to allow execution as another user. Well, from all that I've found, there is no way to get RunAs to spawn a process as SYSTEM, one of the downsides of SYSTEM not being a true user.

Another option that I found (somewhat) attractive initially is RunAsEx, an open source, GUI based version of RunAs. This could be useful, but I found it to be more hassle than it was worth. Still might be useful for somethings, but with all the bugs I found it it, I knew there was a better way.

Now, back to the solution I chose: Using sc to create a service that will execute the application I'm after. This works because by default all services execute under the SYSTEM user context, so all we have to do is create a service to call the application we need. Surprisingly simple, and it works quite well.

Creating the service looks something like this:

SC CREATE AcDebugSvc binPath= "regedit.exe" type= own type= interact **

This creates the service, so that now all you have to do is start the service (SC START AcDebugSvc ***) and you'll see your copy of RegEdit. If you check in Task Manager, you'll be able to confirm that it is actually running as SYSTEM. This is an extremely powerful debugging tool, as it allows you to instantly execute any application as the most powerful user that Windows offers. 

Once you are done with your work, just delete the service (SC DELETE AcDebugSvc) and call it a day, that simple. This can also easily be scripted if you tire of typing the commands so often, and it can also be used with most applications. Using this for the Command Prompt (binPath= "cmd.exe /K start") and for Task Manager (binPath= "taskmgr.exe") both strike me as being quite useful.

* WARNING: As I hope most of you know, System is a very powerful account, it's almost limitless in what it can do. If you aren't careful while working under this user context; you may end up with a rather expensive paperweight instead of a computer. You have been warned. 

** Note: As odd as it is, the spaces after the equals and before the value of the parameters is quite important, the call will fail if you omit them.

*** Note: You'll get an error message ("The service did not respond to the start or control request in a timely fashion.") when you call this, it's nothing to worry about. The reason that it occurs is that to respond to the message it receives the target application must be designed to operate as a service. Since we are using this for other purposes we, we don't really care. 

 

FireFox Toys: ErrorZilla

Filed under Development, Software at 12:49 pm  

While my favorite browser will always be Opera, I'm a big fan of Firefox; its amazing selection of add-ons (a feature that Opera sadly lacks) adds much to its value for me. With the addition of plug-ins like the excellent Web Developer add-on, Firefox becomes a powerful development and browsing platform.

ErrorZilla I just learned of a new add-on released by Eric of roachfiend.com called ErrorZilla, this is a great idea. It's a replacement for the default Firefox error pages, new error pages with additional features. Here's the quick run-down of the new options presented:

  • Try again (refresh)
  • Google Cache
  • Wayback
  • Ping
  • Trace
  • Whois

Now, when faced with a dreaded "Server not found" error, it's much easier to find some useful information. When researching a topic, there's nothing worse than having to go in circles trying to find a page that will load, this add-on is certainly a step in the right direction. I really hope that the Firefox developers see this add-on and consider adding this or similar functionality to the distribution.

 

September 16, 2006

Kill CapsLock!

Filed under Technology at 1:42 pm  

Most people I know have issues with the CapsLock key; with feelings ranging from annoyance to sheer hatred. Personally, I fall into the sheer hatred side of things. I’ve played with various ideas to solve the problem. Everything from a system tray notification when CapsLock is on, to just removing the evil key itself. After all these attempts, I have found I like none of them.

Enter waNOCAPS (from the Winadmin tools project), a registry modification to quickly and cleanly remap the CapsLock to to a third Ctrl key. This is nice is that it’s a simple registry change, not something as ugly as a background program to alter the CapsLock state or value as many CapsLock killers use.

This seems to be a clean, simple solution to a annoying “feature” - one I’ll certainly be using.

Update: It looks like the original page has been removed, but you can still access the files here.

September 3, 2006

Detailed CSS Changes in IE7

Filed under Development at 8:55 pm  

As IE7 approaches release, the IE team has released a detailed list of the 200+ CSS changes that will appear in the final release. If you do any web development, this is a great time to read the list and audit the CSS that your sites use. IE7 breaks many of the old hacks used to work around the bugs in previous versions, so careful attention will be needed to ensure everything keeps working and looking as intended.

IE7 is a major step forward, and all web developers owe the IE team a 'thanks' for being so transparent in this process and making detailed change lists such as this one available.

XML Notepad 2006

Filed under Development, Software at 2:26 pm  

XMLNotepad 2006 Microsoft's Chris Lovett (of System.Xml fame) has released XML Notepad 2006 - a simple, easy to use, and free, XML editor. For those that regularly work with XML, an editor of this type can be an invaluable addition to your toolbox.

XML Notepad offers a basic set of features, great for those quick jobs where using an IDE or a more full-featured application would be overkill. While XML Notepad doesn't offer a great range of features, it does offer some of the most important features needed to get the job done.

As a real bonus, XML Notepad was released complete with its design documentation and source code. Always nice to take a peak under the hood of the projects Microsoft releases.

The only major gripe I have with this tool is the lack of a syntax-highlighted viewer for the XML source. In fact, it uses it's non-XML cousin, Notepad to view the underlying XML. Thankfully, as this project was released with source, it should be easy to add a few new features such as this.

For those interested, here's the feature overview:

  • Tree View synchronized with Node Text View for quick editing of node names and values.
  • Incremental search (Ctrl+I) in both tree and text views, so as you type it navigates to matching nodes.
  • Cut/copy/paste with full namespace support.
  • Drag/drop support for easy manipulation of the tree, even across different instances of XML Notepad and from the file system.
  • Infinite undo/redo for all edit operations.
  • In place popup multi-line editing of large text node values.
  • Configurable fonts and colors via the options dialog.
  • Full find/replace dialog with support for regex and XPath.
  • Good performance on large XML documents, loading a 3mb document in about one second.
  • Instant XML schema validation while you edit with errors and warnings shown in the task list window.
  • Intellisense based on expected elements and attributes and enumerated simple type values.
  • Support for custom editors for date, dateTime and time datatypes and other types like color.
  • Handy nudge tool bar buttons for quick movement of nodes up and down the tree.
  • Inplace HTML viewer for processing xml-stylesheet processing instructions.
  • Built-in XML Diff tool.

 

delegate-insomnia