Air实现托盘图标

<html> <head> <title>xxxx</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <mce:script type="text/javascript" src="AIRAliases.js" mce_src="AIRAliases.js"/><!-- <script type="text/javascript"> var iconLoadComplete = function(event) { air.NativeApplication.nativeApplication.icon.bitmaps = [event.target.content.bitmapData]; } air.NativeApplication.nativeApplication.autoExit = false; var iconLoad = new air.Loader(); var iconMenu = new air.NativeMenu(); var restoreCommand = iconMenu.addItem(new air.NativeMenuItem("恢复窗口")); restoreCommand.addEventListener(air.Event.SELECT,function(event){ window.nativeWindow.visible = true; }); var maximizeCommand = iconMenu.addItem(new air.NativeMenuItem("窗口最大化")); maximizeCommand.addEventListener(air.Event.SELECT,function(event){ window.nativeWindow.maximize(); }); var minimizeCommand = iconMenu.addItem(new air.NativeMenuItem("窗口最小化")); minimizeCommand.addEventListener(air.Event.SELECT,function(event){ window.nativeWindow.minimize(); }); var normalCommand = iconMenu.addItem(new air.NativeMenuItem("窗口正常化")); normalCommand.addEventListener(air.Event.SELECT,function(event){ window.nativeWindow.restore(); }); var exitCommand = iconMenu.addItem(new air.NativeMenuItem("退出系统")); exitCommand.addEventListener(air.Event.SELECT,function(event){ air.NativeApplication.nativeApplication.icon.bitmaps = []; air.NativeApplication.nativeApplication.exit(); }); if (air.NativeApplication.supportsSystemTrayIcon) { air.NativeApplication.nativeApplication.autoExit = false; iconLoad.contentLoaderInfo.addEventListener(air.Event.COMPLETE,iconLoadComplete); iconLoad.load(new air.URLRequest("icons/AIRApp_16.png")); air.NativeApplication.nativeApplication.icon.tooltip = "客服信息系统"; air.NativeApplication.nativeApplication.icon.menu = iconMenu; } if (air.NativeApplication.supportsDockIcon) { iconLoad.contentLoaderInfo.addEventListener(air.Event.COMPLETE,iconLoadComplete); iconLoad.load(new air.URLRequest("icons/AIRApp_128.png")); air.NativeApplication.nativeApplication.icon.menu = iconMenu; } function init() { window.nativeWindow.addEventListener(air.Event.CLOSING, function(event){ window.nativeWindow.orderToFront(); window.nativeWindow.visible = false; event.preventDefault(); }); } // --></mce:script> </head> <body onload="init()" >fdsaf </body> </html>

你可能感兴趣的:(function,AIR)