简体   繁体   English

C# AutoIt InteropServices.COMException 错误

[英]C# AutoIt InteropServices.COMException error

Hi I added my windows form a hook shortcut key purpose of pixelbot it works like charm in minute but suddenly it gives error au3.WinActivate("WarUniverse", "");嗨,我添加了我的 windows 形成像素机器人的挂钩快捷键用途,它在几分钟内就像魅力一样工作,但突然出现错误 au3.WinActivate("WarUniverse", ""); au3.WinSetState("WarUniverse", "", au3.SW_MAXIMIZE); au3.WinSetState("WarUniverse", "", au3.SW_MAXIMIZE); Error is in this line.错误在这一行。 I can not active the game window It probably conflict with somethink but I dont know what it is.我无法激活游戏 window 它可能与某些想法冲突,但我不知道它是什么。

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();
    }

Error (Turkish)错误(土耳其语)

System.Runtime.InteropServices.COMException: 'Uygulama, giriş zaman uyumlu bir çağrı gönderdiği için giden bir çağrı yapılamıyor. 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))' (0x8001010D (RPC_E_CANTCALLOUT_ININPUTSYNCCALL))'

test if window is present to be sure:测试 window 是否存在以确保:

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

you dont need to activate it, you could directly to maximize the window你不需要激活它,你可以直接最大化window

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 com 异常 excel InteropServices.COMException - c# - com exception excel InteropServices.COMException - c# InteropServices.COMException - InteropServices.COMException 为什么我在尝试从 C# 启动 QTP 时收到 InteropServices.COMException? - Why do I get an InteropServices.COMException when attempting to launch QTP from C#? Excel中interopServices C#的COMException - COMException with interopServices C# in Excel 将项目添加到 ObservableCollection 时出现 InteropServices.COMException - InteropServices.COMException when adding item to ObservableCollection c#Windbg中的System.Runtime.InteropServices.COMException错误 - c# System.Runtime.InteropServices.COMException error in windbg 从页面调用静态异步方法导致 InteropServices.COMException 错误 - Calling a static async method from a Page results in InteropServices.COMException error 间歇性的“ InteropServices.COMException / ForwardCallToInvokeMember”在范围单元格上访问Value2 - Intermittent “InteropServices.COMException / ForwardCallToInvokeMember” accessing Value2 on Range cell 如何在不安装Excel的情况下修复InteropServices.COMException? - How can I fix InteropServices.COMException without installing Excel? 为什么使用此代码会得到“ InteropServices.COMException / ForwardCallToInvokeMember”? - Why would I get, “InteropServices.COMException / ForwardCallToInvokeMember” with this code?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM