What's new
Visual Studio.Net Help Community

A community to get Microsoft Visual Studio.Net programming help.

Visual Studio.Net Help Community is a community for .Net programmers to interact with people who want to learn to program using the Microsoft Visual Studio.Net languages or who program using the Microsoft .Net languages and want to share their .Net knowledge.

Visual Studio.Net Help Community is a free programmer help site so why not join the community today? Once you are a member you get access to all our .Net programming discussions.

SendMessage for keystroke is not working



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.




SendMessage(hwndWindow, WM_SETFOCUS, VK_TAB, 0); //tried also without

SendMessage(hwndWindow, WM_SETFOCUS, VK_TAB, 0); //these 2 messages


SendMessage(hwndWindow, WM_KEYDOWN, VK_TAB, 0);

SendMessage(hwndWindow, WM_KEYUP, VK_TAB, 0);


SendMessage(hwndWindow, WM_KEYDOWN, VK_DOWN, 0);

SendMessage(hwndWindow, WM_KEYUP, VK_DOWN, 0);

Many thanks in advance​


Continue reading...

Top Bottom