我能够在游戏植物大战僵尸中找到Windows,但在生化危机中没有运气。有人可以帮助我吗?我相对而言是新手。C++无法找到窗口
这是代码简单,但没有运气:(
#include "stdafx.h"
#include <iostream>
#include <windows.h>
#define F6_Key 0x75
using namespace std ;
int main()
{
cout << "Open Game .." << endl ;
system("Pause") ;
LPCWSTR game = L"Resident Evil 0/biohazard 0 HD REMASTER";
HWND hwnd = FindWindowW(0, L"Resident Evil/biohazard HD REMASTER");
if (hwnd == 0)
{
cout << "Not Found." << endl ;
system("Pause") ;
}
else
{
cout << "Success finding game." << endl;
}
return 0 ;
}
为什么你要在一个变量中存储一个字符串文字,只是为了在别的地方写出来呢? – Rakete1111
我从网站上拿了样本,但是如果我删除L,它会在参数 – user3171557
上标记为错误,我会列举窗口。也许标题不完全匹配。下面是一个例子:https://gist.github.com/LeZuse/6994454 – drescherjm