You can use SendInput to simulate mouse and keyboard events
But the window must be in foreground
I tested with a demo version, to set it to foreground :
HWND hWndDest = FindWindow(L"GLFW30", NULL);
SwitchToThisWindow(hWndDest, TRUE);
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hello, I have a task to create a bot for minecraft for digging in the background. I'm new to WinAPI and I don't know what I was supposed to do. I create a HWND and I find a window, now when I try to PostMessage() to minecraft then the character does nothing, only in chat my messages are typed into the chat bar. I tried with Spy++ and sending messages to minecraft’s subwindows and still nothing. Anyone know what to do?
You can use SendInput to simulate mouse and keyboard events
But the window must be in foreground
I tested with a demo version, to set it to foreground :
HWND hWndDest = FindWindow(L"GLFW30", NULL);
SwitchToThisWindow(hWndDest, TRUE);