SendKeys.SendWait不适用于Stella仿真器

时间:2015-11-11 10:47:25

标签: c# emulation

尝试了几天没有任何成功。 我只是想向一个进程发送击键,这是一个Atari视频游戏模拟器(Stella)。

我的应用程序是使用VS 2013制作的C#中的控制台应用程序,在64位Windows 7中运行。

方法 Sendkeys.Wait 适用于几乎所有应用,例如calc,excel,notepad等。

尝试了一些方法,例如:

[DllImport("USER32.DLL", CharSet = CharSet.Unicode)]
public static extern IntPtr FindWindow(string lpClassName, string lpWindowName);

[DllImport("USER32.DLL")]
public static extern bool SetForegroundWindow(IntPtr hWnd);

static private void Teste(string key)
{
    IntPtr stellaHandle = FindWindow("SDL_app", "Stella 4.6.7: \"River Raid (1982) (Activision)\"");

    SetForegroundWindow(stellaHandle);
    SendKeys.SendWait(key);
}

我在任何CPU,x86和x64中编译,使用32位和64位版本的Stella,也尝试使用其他模拟器(Z26),甚至尝试使用在Firefox中运行的javascript模拟器(http://www.virtualatari.org)。 / p>

我的方法都没有奏效。窗口没问题。将窗口设置为前景也可以。

有什么想法吗?有人在此之前遇到过这样的问题吗?

提前致谢。

0 个答案:

没有答案