Exemplo n.º 1
0
        public bool SetDict()//设置系统路径和字典
        {
            int dmae;

            switch (WindowsFormsApplication1.BaseData.SystemInfo.BindWindowsType)
            {
            case 1:    //1是大漠2是AE
            {
                dmae = dm.SetPath(Application.StartupPath);
                if (dmae == 1)
                {
                    ;
                }
                else
                {
                    WriteLog.WriteError("设置路径失败");
                }
                dmae = dm.SetDict(0, @"\Resources\dm_soft0.txt");
                dmae = dm.SetDict(1, @"\Resources\TeamList.txt");
                dmae = dm.SetDict(2, @"\Resources\dm_soft2.txt");
                dmae = dm.SetDict(3, @"\Resources\LTeamList.txt");
                dmae = dm.SetDict(4, @"\Resources\BTime.txt");
                dmae = dm.SetDict(5, @"\Resources\Mission.txt");
                if (dmae == 1)
                {
                    ;
                }
                else
                {
                    WriteLog.WriteError("初始化字典失败");
                }
                if (dmae == 1)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }

            case 2:
            {
                dmae = dm.SetPath(Application.StartupPath);
                if (dmae == 1)
                {
                    ;
                }
                else
                {
                    WriteLog.WriteError("设置路径失败");
                }
                dmae = dm.SetDict(0, @"\Resources\dm_soft0.txt");
                dmae = dm.SetDict(1, @"\Resources\TeamList.txt");
                dmae = dm.SetDict(2, @"\Resources\dm_soft2.txt");
                dmae = dm.SetDict(3, @"\Resources\LTeamList.txt");
                dmae = dm.SetDict(4, @"\Resources\BTime.txt");
                dmae = dm.SetDict(5, @"\Resources\Mission.txt");
                if (dmae == 1)
                {
                    ;
                }
                else
                {
                    WriteLog.WriteError("初始化字典失败");
                }
                if (dmae == 1)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }

            default:
                return(false);
            }
        }
Exemplo n.º 2
0
        public int FindWindow()
        {
            switch (BaseData.SystemInfo.Simulator)
            {
            case 0:
            {
                try
                {
                    string temp0 = dm.EnumWindow(0, "QWidgetClassWindow", "Qt5QWindowIcon", 1 + 2);        //temp自动找
                    if (temp0 != "")
                    {
                        string[] s = temp0.Split(new char[] { ',' });
                        BaseData.SystemInfo.GameWindowsHwnd = Int32.Parse(s[1]);
                    }
                    return(-2);
                }
                catch (Exception ex)
                {
                    MessageBox.Show("无法找到模拟器窗口", "少女前线");
                    WriteLog.WriteError("查找句柄" + ex.ToString());
                    return(-2);
                }
            }

            case 1:
            {
                try
                {
                    BaseData.SystemInfo.GameWindowsHwnd = Convert.ToInt32(dm.EnumWindow(0, "WndTxtCore", "XXEmulatorCore", 1 + 2));        //temp自动找
                    break;
                }
                catch (Exception ex)
                {
                    MessageBox.Show("无法找到模拟器窗口", "少女前线");
                    WriteLog.WriteError("查找句柄" + ex.ToString());
                    return(-2);
                }
            }

            case 2:
            {
                try
                {
                    BaseData.SystemInfo.GameWindowsHwnd = Convert.ToInt32(dm.EnumWindow(0, "kaopu001_tiantianplayer_opengl_wndWindow", "Qt5QWindowIcon", 1 + 2));        //temp自动找
                }
                catch (Exception ex)
                {
                    MessageBox.Show("无法找到模拟器窗口", "少女前线");
                    WriteLog.WriteError("查找句柄" + ex.ToString());
                    return(-2);
                }
                //variables.GameWindowsHwnd = Convert.ToInt32(dm.EnumWindow(0, "kaopu001_tiantianplayer_opengl_wndWindow", "Qt5QWindowIcon", 1 + 2));//temp自动找
                break;
            }

            case 3:    //靠谱助手 BS2HD
            {
                try
                {
                    string temp0 = dm.EnumWindow(0, "kpzs  -- Power plus BlueStacks", "", 1 + 2);        //temp自动找
                    if (temp0 != "")
                    {
                        string[] s = temp0.Split(new char[] { ',' });
                        BaseData.SystemInfo.GameWindowsHwnd = Int32.Parse(s[0]);
                    }
                    return(-2);
                }
                catch (Exception ex)
                {
                    MessageBox.Show("无法找到模拟器窗口", "少女前线");
                    WriteLog.WriteError("查找句柄" + ex.ToString());
                    return(-2);
                }

                //variables.GameWindowsHwnd = Convert.ToInt32(dm.EnumWindow(0, "kpzs  -- Power plus BlueStacks", "", 1 + 2));//temp自动找
            }

            case 4:    //靠谱助手 BS
            {
                try
                {
                    string temp0 = dm.EnumWindow(0, "kpzs  -- Power by BlueStacks", "Mono.WinForms.0.0", 1 + 2);        //temp自动找
                    if (temp0 != "")
                    {
                        string[] s = temp0.Split(new char[] { ',' });
                        BaseData.SystemInfo.GameWindowsHwnd = Int32.Parse(s[0]);
                    }
                    return(-2);
                }
                catch (Exception ex)
                {
                    MessageBox.Show("无法找到模拟器窗口", "少女前线");
                    WriteLog.WriteError("查找句柄" + ex.ToString());
                    return(-2);
                }

                //variables.GameWindowsHwnd = Convert.ToInt32(dm.EnumWindow(0, "kpzs  -- Power plus BlueStacks", "", 1 + 2));//temp自动找
            }

            case 5:
            {
                try
                {
                    string temp0 = dm.EnumWindow(0, "AEngineRenderWindow", "AEngineRenderWindowClass", 1 + 2);        //temp自动找
                    if (temp0 != "")
                    {
                        BaseData.SystemInfo.GameWindowsHwnd = Int32.Parse(temp0);
                        break;
                    }
                    return(-2);
                }
                catch (Exception ex)
                {
                    MessageBox.Show("无法找到模拟器窗口", "少女前线");
                    WriteLog.WriteError("查找句柄" + ex.ToString());
                    return(-2);
                }
            }

            default:
                break;
            }
            return(-1);
        }