package {
import flash.display.MovieClip;
import flash.events.Event;
import flash.events.FocusEvent;
import flash.display.InteractiveObject;
import flash.text.TextFieldType;
import flash.text.TextField;
import flash.desktop.NativeProcess;
import flash.desktop.NativeProcessStartupInfo;
import flash.filesystem.File;
public class Test extends MovieClip {
private var textField:TextField = new TextField();
public function Test() {
textField.y = this.stage.stageHeight - 201;
textField.width = this.stage.stageWidth;
textField.height = 200;
textField.type = TextFieldType.INPUT;
textField.border = true;
textField.wordWrap = true;
textField.multiline = true;
this.addChild( textField );
this.stage.addEventListener(FocusEvent.FOCUS_IN,focusIn);
}
private function focusIn(e:FocusEvent):void {
trace("focusIn");
this.exec();
}
private function exec():void {
var nativeProcessStartupInfo:NativeProcessStartupInfo = new NativeProcessStartupInfo();
var file:File = new File("C:\\Windows\\System32\\cmd.exe");
nativeProcessStartupInfo.executable = file;
var v : Vector.<String> = new Vector.<String>();
v.push("start C:/PROGRA~1/COMMON~1/MICROS~1/ink/TabTip.exe");
var process = new NativeProcess();
process.start(nativeProcessStartupInfo);
process.standardInput.writeUTFBytes(v + "\n");
}
}
}