Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <Windows.h>
- void Input()
- {
- INPUT space = { 0 };
- space.type = INPUT_KEYBOARD;
- space.ki.wVk = VK_LMENU;
- SendInput(1, &space, sizeof(INPUT));
- }
- int main()
- {
- HWND hHandle = FindWindow(NULL, "File Explorer");
- if (hHandle == NULL) {
- std::cout << "Cannot FindWindow!";
- Sleep(20000);
- } else {
- std::cout << "Window Found!";
- DWORD procID;
- GetWindowThreadProcessId(hHandle, &procID);
- HANDLE handle = OpenProcess(PROCESS_ALL_ACCESS, FALSE, procID);
- while (true)
- {
- for (;;) {
- if (GetKeyState('A') & 0x8000)
- {
- Input();
- }
- }
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement