Where is ALT key defined?

Need to do this:
::SendMessage(hwnd, WM_KEYDOWN, VK_ALT,0);

Compiler says:
C:\MyInspect\MyMain.cpp|155|error: 'VK_ALT' was not declared in this scope|

Any include needed? Which one?

Thanks a lot
Env: Win7, Mingw, Wxwidgets 3
Last edited on
Nowhere. There is no VK_ALT.

You want VK_MENU.

See this page for valid virtual key codes:


Note: for VK_MENU, you only need to #include <Windows.h>


also... sending phony keydown messages is questionable. But whatever.
Last edited on
This is for a kind of robot app for gui stress testing. I need to send alt f1
Topic archived. No new replies allowed.