As The Title Says I want to make a code or a app that runs in the background which clicks repeatedly so far I was only able to make a click code which is
void Click() {
INPUT iNPUTh = { 0 };
iNPUTh.type = INPUT_MOUSE;
iNPUTh.mi.dwFlags = MOUSEEVENTF_LEFTDOWN;
SendInput(1, &iNPUTh, sizeof(iNPUTh));
ZeroMemory(&iNPUTh, sizeof(iNPUTh));
iNPUTh.type = INPUT_MOUSE;
iNPUTh.mi.dwFlags = MOUSEEVENTF_LEFTUP;
SendInput(1, &iNPUTh, sizeof(iNPUTh));
}
int main() {
HWND hhProcess;
hhProcess = FindWindow(NULL, L"ARK: Survival Evolved");
if (hhProcess) {
AllocConsole();
cout << "Process Found!" << endl;
}
while (true) {
if (GetAsyncKeyState(VK_Numpad0) {
Click()
}
}
}
But my problem is that once I start to run it, it clicks on the surface what I want to happen is that it clicks on a background process