问题
I think I know the answer to this (no) but I thought I would ask:
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.
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.
回答1:
I think this is possible only using an external soft.
For that we need :
An external soft to hide and show Windows Start button as Start Killer.
Communicating with native processes in AIR.
And then Packaging a desktop native installer.
For that, I wrote this code which do the work very fine.
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.
I hope all that can help you.
来源:https://stackoverflow.com/questions/27345184/possible-to-disable-windows-start-menu-while-air-app-is-running