Example #1
0
        private void ConfirmBtn_BtnClick(object sender, EventArgs e)
        {
            if (SelectGameWindowBtn.BtnText == "结束选择")
            {
                hook.Stop();
            }

            if (gamePID != -1)
            {
                string game_ID = null;
                try
                {
                    game_ID = FindProcessPath(gamePID);
                }
                catch (System.ComponentModel.Win32Exception ex)
                {
                    MessageBox.Show("无法捕捉64位程序,请使用64位翻译器再次尝试", "错误");
                    return;
                }
                Common.GameID = Common.GetGameID(game_ID);

                SQLiteHelper sqliteH = new SQLiteHelper(Environment.CurrentDirectory + "\\settings\\GameList.sqlite");
                sqliteH.ExecuteSql(string.Format("UPDATE gamelist SET gameName = '{0}' WHERE gameID = {1};", System.IO.Path.GetFileName(game_ID), Common.GameID));

                if (SameNameGameProcessList.Count == 1)
                {
                    Common.TextractorHandle = new TextHookHandle(gamePID);
                }
                else
                {
                    Common.TextractorHandle = new TextHookHandle(SameNameGameProcessList);
                }
                Common.TextractorHandle.Init();
                Common.TextractorHandle.StartHook();

                this.TopMost = false;

                TextractorFunSelectForm tfsf = new TextractorFunSelectForm();
                Common.TextractorHandle.SetSettingsOutPutform(tfsf);
                tfsf.Show();

                this.Close();
            }
            else
            {
                MessageBox.Show("请先选择一个进程再进行下一步操作!", "提示");
            }
        }
Example #2
0
        private void ConfirmBtn_BtnClick(object sender, EventArgs e)
        {
            if (SelectGameWindowBtn.BtnText == "结束选择")
            {
                hook.Stop();
            }

            if (gamePID != -1)
            {
                string game_ID = null;
                try
                {
                    game_ID = FindProcessPath(gamePID);
                }
                catch (System.ComponentModel.Win32Exception ex)
                {
                    MessageBox.Show("无法捕捉64位程序,请使用64位翻译器再次尝试", "错误");
                    return;
                }
                Common.GameID = Common.GetGameID(game_ID);
                IniFileHelper.WriteValue(Environment.CurrentDirectory + "\\GameListInfo.ini", "Game" + Common.GameID, "gameName", System.IO.Path.GetFileName(game_ID));

                if (SameNameGameProcessList.Count == 1)
                {
                    Common.TextractorHandle = new TextHookHandle(gamePID);
                }
                else
                {
                    Common.TextractorHandle = new TextHookHandle(SameNameGameProcessList);
                }
                Common.TextractorHandle.Init();
                Common.TextractorHandle.StartHook();

                this.TopMost = false;

                TextractorFunSelectForm tfsf = new TextractorFunSelectForm();
                Common.TextractorHandle.SetSettingsOutPutform(tfsf);
                tfsf.Show();

                this.Close();
            }
            else
            {
                MessageBox.Show("请先选择一个进程再进行下一步操作!", "提示");
            }
        }