Fixed the code i had above (there were typos and such :P)
Most of this particular coding was taken from the Adobe AIR 1.5 documentation, and as you see, I didn't use any Ext functions, although you can if you want 
Code:
// Create new window properties
var winProperties = new air.NativeWindowInitOptions();
winProperties.maximizable = true;
winProperties.minimizable = true;
// Define the size and position of the new window
var winSize = new air.Rectangle(200,200,640,480); // X position, Y Position, Width, Height
// Create the new window loader
var winLoader = air.HTMLLoader.createRootWindow(true, winProperties, true, winSize);
var mainWin = winLoader.stage.nativeWindow;
// Check if we can create a System Tray Icon
if (air.NativeApplication.supportsSystemTrayIcon) {
// Add Event Listener to the new window for display state change
mainWin.addEventListener(air.NativeWindowDisplayStateEvent.DISPLAY_STATE_CHANGE, function(evt) {
if (evt.afterDisplayState == air.NativeWindowDisplayState.MINIMIZED) {
// If minimized, hide the window (ie, not listed in taskbar)
mainWin.visible = false;
}
});
// By default, there is no icon for the system tray, so load one!
var iconLoad = new air.Loader();
iconLoad.contentLoaderInfo.addEventListener(air.Event.COMPLETE,function(evt){
air.NativeApplication.nativeApplication.icon.bitmaps = [evt.target.content.bitmapData];
});
iconLoad.load(new air.URLRequest("icons/AIRApp_16.png"));
// Assign tooltip to icon
air.NativeApplication.nativeApplication.icon.tooltip = "MinToTray Example";
// Exit Function
function exitRoutine() {
air.NativeApplication.nativeApplication.exit();
};
// Create a tray menu
var trayMenu = new air.NativeMenu();
// Menu Option: Open
var winMenuOpen = trayMenu.addItem(new air.NativeMenuItem("Open"));
winMenuOpen.addEventListener(air.Event.SELECT,function() {
mainWin.visible = true; // Make visible again
mainWin.restore(); // Restore it, since it is minimized!
mainWin.orderToFront(); // Bring to front (optional)
mainWin.activate(); // Make it the active/selected window (optional)
});
// Menu Option: Exit
var winMenuExit = trayMenu.addItem(new air.NativeMenuItem("Exit"));
winMenuExit.addEventListener(air.Event.SELECT,exitRoutine);
// Assign the menu to the icon
air.NativeApplication.nativeApplication.icon.menu = trayMenu;
}
// Create and load the new window
winLoader.load(new air.URLRequest('mainwindow.html'));
// Define the "opener" window (ie THIS window, minimizetotray.html)
winLoader.window.opener = window;