我可以用AdobeAIR创建Windows屏幕保护程序吗?

我可以用AdobeAIR创建Windows屏幕保护程序吗?,air,screensaver,Air,Screensaver,从技术上讲,使用AdobeAIR为Windows创建屏幕保护程序是否可行?解决方法是在Windows窗体exe中托管.swf。我目前使用C#/.NET4.0来实现这一点。首先,您需要将.exe配置为屏幕保护程序。完成后,需要将.exe重命名为.scr。在windows窗体中,您需要嵌入一个Flash Active X对象,然后将windows窗体设置为无边框等 如果需要,.swf可以通过fscommand调用与.scr通信。例如,我在.swf中侦听mouseMove事件,然后通过fscomman

从技术上讲,使用AdobeAIR为Windows创建屏幕保护程序是否可行?

解决方法是在Windows窗体exe中托管.swf。我目前使用C#/.NET4.0来实现这一点。首先,您需要将.exe配置为屏幕保护程序。完成后,需要将.exe重命名为.scr。在windows窗体中,您需要嵌入一个Flash Active X对象,然后将windows窗体设置为无边框等

如果需要,.swf可以通过fscommand调用与.scr通信。例如,我在.swf中侦听mouseMove事件,然后通过fscommand告诉.scr关闭

有一个免费的工具可以将.swf文件转换为名为InstantStorm的屏幕保护程序,但我个人更喜欢Windows窗体方法,因为它允许更多的控制

是的

您可以使用-captive runtime-target bundle编译AIR项目(使其成为独立的.exe文件而不是.AIR文件)

对于windows,只需将.exe重命名为.scr,右键单击并选择“安装”或“测试”

如果要将其设置为配置和预览模式,可以侦听应用程序调用事件:

    //put this in your app main constructor
    NativeApplication.nativeApplication.addEventListener(InvokeEvent.INVOKE, invokEventHandler, false, 0, true);

    protected function invokEventHandler(e:InvokeEvent):void {
            //you don't actually have to loop as it will always be the first argument
            for each(var a:String in e.arguments) {
                //p - Show the screensaver in the screensaver selection dialog box
                if (a.indexOf("/p")) {
                    //do something different for preview mode
                    break;
                }
                //s - Show the screensaver full-screen
                if (a.indexOf("/s")) {
                    //the main full screen mode
                    break;
                }
                //c - Show the screensaver configuration dialog box
                if (a.indexOf("/c")) {
                    //show a configuration window
                    break;
                }
            }
    }

一点也不。屏幕保护程序必须包含可由Windows加载的特定功能,而AIR并没有为您提供提供这些功能的方法。@KenWhite&Pavel-事实上这是可能的,我添加了一个答案,希望能很好地解释这一点。