Mouse and Keyboard
Changing other window's properties
- Demonstration
- Functionality:
- Create one window
- To select the target window: press left mouse button, drag over the target window
and release the button
- Only the top level windows can be selected, in other words, be sure that the
target window has the NULL value as the parent window (if not, get the parent, the parent
of the parent etc.)
- The selection of the target window should change while moving the mouse with pressed the left
mouse button (as in the demonstration)
- The handle and title of the target window appears as the caption of the
application's window
- The handle is displayed as a hexadecimal number
- When there is a target window selected, allow to change its properties:
- Keys: Left, Right, Up, and Down move the target window
(in an appropriate direction)
- Keys: Left, Right, Up, and Down with the Shift key pressed change the size
of the target window (see the demonstration)
- Text typed using the keyboard (4 characters without the quotation marks;
only lowercase):
- "mini" - minimizes the target window
- "maxi" - maximizes it
- "rest" - restores it
- "hide" - hides it
- "show" - shows it
- Hints:
- WindowFromPoint(), GetParent()
- GetWindowText(), SetWindowText()
- GetWindowRect(), MoveWindow()
- WM_LBUTTONDOWN, WM_LBUTTONUP, WM_MOUSEMOVE
- SetCapture(), ReleaseCapture()
- ClientToScreen()
- WM_KEYDOWN, WM_CHAR
- VK_LEFT, VK_RIGHT, VK_UP, VK_DOWN, GetKeyState()
- ShowWindow()
- Approximate points:
- selecting the target window (the top level window): 3.5
- the handle and title of the target window visible on the caption bar: 1.0
- moving and resizing the target window: 2.5
- changing visibility and state (minimized, maximized, restored) of the target window: 3.0