可以在 AIR 应用程序运行时禁用 Windows 开始菜单吗? [英] Possible to disable Windows Start Menu while AIR app is running?

查看:22
本文介绍了可以在 AIR 应用程序运行时禁用 Windows 开始菜单吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I think I know the answer to this (no) but I thought I would ask:

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

Is it possible to disable the Windows Start Menu while an AIR app is running?

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

The legacy app I am revising needs to run in a screen-sized "window" mode in order to have access to the native menu system. There are some buttons that are close to the bottom edge of the screen and it is very easy to trigger the Start Menu sliding on.

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

I know I could, maybe should redo the menus to use Flex components and run fullscreen (where the Start menu is apparently disabled) but the budget is tight.

推荐答案

我认为只有使用外部软件才能做到这一点.

I think this is possible only using an external soft.

为此我们需要:

  • 用于隐藏和显示 Windows 开始按钮的外部软件 Start Killer.

与 AIR 中的本机进程通信.

然后打包桌面本机安装程序.

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

For that, I wrote this code which do the work very fine.

在应用程序启动时,我隐藏了 Windows 开始按钮,而在退出应用程序时,我会显示它.

At app start I hide Windows Start button and when exiting the app, I show it.

<?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>

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

I created also an install if you want to test it before changing your code, you can download it here.

希望能帮到你.

这篇关于可以在 AIR 应用程序运行时禁用 Windows 开始菜单吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆