Esempio n. 1
0
 public ScriptController()
 {
     this.isRunning = false;
     this.stopFlag  = false;
     this.form      = null;
     this.status    = ScriptControllerStatus.Uninitialized;
 }
Esempio n. 2
0
        private void execute()
        {
            Debug.WriteLine("ScriptController.execute()");

            if (this.status == ScriptControllerStatus.Uninitialized)
            {
                this.setStatusText("初期化中...");
                this.fireTimer();
                this.status = ScriptControllerStatus.Initialized;
                this.launcherWindowHandle = IntPtr.Zero;

                this.setStatusText("起動チェック中...");
                if (this.isFF14LauncherBooted() == false)
                {
                    this.launchFF14();
                }
                this.setStatusText("ランチャー起動中...");
                this.status = ScriptControllerStatus.BootingLauncher;

                return;
            }

            if (this.status == ScriptControllerStatus.BootingLauncher)
            {
                if (this.launcherWindowHandle == IntPtr.Zero)
                {
                    // error
                    return;
                }
                // const int EM_SETPASSWORDCHAR = 0xCC;
                // PostMessage(this.launcherWindowHandle, EM_SETPASSWORDCHAR, 0, 0);

                Debug.WriteLine("========================");
                EnumChildWindows(this.launcherWindowHandle, EnumIEServerProc, ref this.ieServerHandle);
                if (this.ieServerHandle == IntPtr.Zero)
                {
                    return;
                }

                Debug.WriteLine("Internet Explorer_Server found!");

                uint   msg    = RegisterWindowMessage("WM_HTML_GETOBJECT");
                IntPtr result = IntPtr.Zero;
                SendMessageTimeout(this.ieServerHandle, msg, IntPtr.Zero, IntPtr.Zero, SendMessageTimeoutFlags.SMTO_ABORTIFHUNG, 1000, out result);
                if (result == IntPtr.Zero)
                {
                    return;
                }

                Debug.WriteLine("result received!");
                //Object spDoc = null;

                Guid IID_IHTMLDocument = new Guid("626FC520-A41E-11CF-A731-00A0C9082637");
                // IHTMLDocument2 document;
//                ObjectFromLresult(result,
//                If Not lRes = IntPtr.Zero Then
//                    ObjectFromLresult(lRes, IID_IHTMLDocument, 0, spDoc)
//                End If

                return;
            }

            return;
        }