Guest poirepoisson Posted October 21, 2021 Posted October 21, 2021 Hi all could you please tell me why this code does not work? It should simulate the pression of TAB and then arrow DOWN, but nothing happens. I´m sure I have the right handle to the window, because I can click with the mouse on some of its buttons. SetForegroundWindow(hwndWindow); SetActiveWindow(hwndWindow); SetFocus(hwndWindow); SendMessage(hwndWindow, WM_SETFOCUS, VK_TAB, 0); //tried also without SendMessage(hwndWindow, WM_SETFOCUS, VK_TAB, 0); //these 2 messages Sleep(500); SendMessage(hwndWindow, WM_KEYDOWN, VK_TAB, 0); SendMessage(hwndWindow, WM_KEYUP, VK_TAB, 0); Sleep(1000); SendMessage(hwndWindow, WM_KEYDOWN, VK_DOWN, 0); SendMessage(hwndWindow, WM_KEYUP, VK_DOWN, 0); Many thanks in advance Fede Continue reading... Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.