im new to windows programming. how do i make certain events trigger when user presses a certain key. like i want a square to be drawn on the window if user presses "s".
im new to windows programming. how do i make certain events trigger when user presses a certain key. like i want a square to be drawn on the window if user presses "s".
Typically you might handle WM_KEYDOWN to respond to keyboard input and do your drawing within your WM_PAINT message handler. You can use, for example, InvalidateRect or UpdateWindow in response to WM_KEYDOWN messages of interest to ensure painting occurs as you require.
Draw the rectangle or square with, unsurprisingly, Rectangle.
For more information on using WM_PAINT, start here.
CProgramming FAQ
Caution: this person may be a carrier of the misinformation virus.