【问题标题】:Possible to disable Windows Start Menu while AIR app is running?可以在 AIR 应用程序运行时禁用 Windows 开始菜单吗?
【发布时间】:2014-12-07 17:00:11
【问题描述】:

我想我知道答案(),但我想我会问:

是否可以在 AIR 应用程序运行时禁用 Windows 开始菜单?

我正在修改的旧版应用程序需要在屏幕大小的“窗口”模式下运行,才能访问本机菜单系统。有一些按钮靠近屏幕底部边缘,很容易触发开始菜单滑动。

我知道我可以,也许应该重做菜单以使用 Flex 组件并全屏运行(开始菜单显然被禁用)但预算很紧。

【问题讨论】:

    标签: actionscript-3 apache-flex air flex4


    【解决方案1】:

    我认为这只能使用外部软件。

    为此我们需要:

    为此,我编写了这段代码,它可以很好地完成工作。

    在应用启动时我隐藏 Windows 开始按钮,在退出应用时显示它。

    <?xml version="1.0" encoding="utf-8"?>
    <s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009" 
                           xmlns:s="library://ns.adobe.com/flex/spark" 
                           xmlns:mx="library://ns.adobe.com/flex/mx" creationComplete="init(event)">
    
        <fx:Script>
            <![CDATA[
    
                import mx.events.FlexEvent
    
                private const exe_name:String = 'StartKiller.exe'
                private var native_process_startup_info:NativeProcessStartupInfo
                private var exe_file:File = File.applicationDirectory.resolvePath(exe_name) 
                private var process:NativeProcess
                private var process_args:Vector.<String> = new Vector.<String>()            
    
                protected function init(event:FlexEvent):void
                {
                    // run our exe to hide start button
                    native_process_startup_info = new NativeProcessStartupInfo()
                    native_process_startup_info.executable = exe_file
    
                    process = new NativeProcess()
                    process.start(native_process_startup_info)
    
                    NativeApplication.nativeApplication.addEventListener(Event.EXITING, function(e:Event):void{
    
                        // exit our exe and show start button
                        native_process_startup_info = new NativeProcessStartupInfo()
                        native_process_startup_info.executable = exe_file
    
                        process_args = new Vector.<String>()
                        process_args.push('exit')       
    
                        native_process_startup_info.arguments = process_args
    
                        process = new NativeProcess()
                        process.start(native_process_startup_info)
    
                    })
                }
    
            ]]>
        </fx:Script>
    </s:WindowedApplication>
    

    如果您想在更改代码之前对其进行测试,我还创建了一个安装程序,您可以下载它here

    希望对你有帮助。

    【讨论】:

      猜你喜欢
      • 2012-06-15
      • 2021-07-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-12-01
      • 1970-01-01
      • 1970-01-01
      • 2011-06-26
      相关资源
      最近更新 更多