【问题标题】:InteropServices.COMException error when activating game window激活游戏窗口时出现 InteropServices.COMException 错误
【发布时间】:2021-05-23 12:36:31
【问题描述】:

我在我的窗口中添加了一个快捷键挂钩,用于像素搜索机器人。突然它给出了一个错误。错误在这一行:

au3.WinActivate("WarUniverse", "");
                au3.WinSetState("WarUniverse", "", au3.SW_MAXIMIZE);

我无法激活游戏窗口。它可能与某些东西冲突,但我不知道是什么。

void CheckKeyCombo()
    {
        if (lctrlKeyPressed && f9KeyPressed)
        {
            BaslaBtn.PerformClick();
        }
    }
    public void Checkbox()
    {
        if (BonusCheck.Checked)
        {
            Thread bot = new Thread(KutuToplama) { IsBackground = true };
            if (buttonswitch == false)
            {
                BaslaBtn.Text = "Start";
                kututoplama = false;
                buttonswitch = true;
            }
            else
            {
                BaslaBtn.Text = "Stop";
                kututoplama = true;
                au3.WinActivate("WarUniverse", "");
                au3.WinSetState("WarUniverse", "", au3.SW_MAXIMIZE);
                bot.Start();
            }
        }
        else
        {               
            MessageBox.Show("Please choose a option for bot ", "DolunayBot", MessageBoxButtons.OK, MessageBoxIcon.Error);
        }
    }
    private void BaslaBtn_Click(object sender, EventArgs e)
    {
        Checkbox();
    }

错误(土耳其语):

System.Runtime.InteropServices.COMException: 'Uygulama, giriş zaman uyumlu bir çağrı gönderdiği için giden bir çağrı yapılamıyor。 (0x8001010D (RPC_E_CANTCALLOUT_ININPUTSYNCCALL))'

【问题讨论】:

    标签: c# interopservices autoit-c#-wrapper


    【解决方案1】:

    测试窗口是否存在以确保:

    au3.WinWait("WarUniverse");
    au3.WinSetState("WarUniverse", "", au3.SW_MAXIMIZE);
    

    你不需要激活它,你可以直接最大化窗口

    【讨论】:

      猜你喜欢
      • 2020-05-11
      • 1970-01-01
      • 2021-08-06
      • 1970-01-01
      • 1970-01-01
      • 2017-11-11
      • 1970-01-01
      • 2012-10-28
      • 2018-07-07
      相关资源
      最近更新 更多