Krzysztof Mossakowski
Windows Programming
2006 - Tasks
Windows
Version A
Marking windows
Demonstration
Functionality:
mark a window at current mouse position and all its ancestors (a parent, a grandparent and so on)
you can assume that the number of ancestors is limited, but the program should never crash
The main window:
closeable (closing this window should terminate the application)
show number of marked windows in the title
Popup windows used for marking windows of other applications:
features:
no caption, no border
always on top
background color - system color for active window's caption
not visible on the taskbar
position and size - use 4 popup windows per one marked window to create visible border (like in the demonstration)
number of popup windows should be appropriate for current situation, e.g. exactly 12 popup windows should exist for 3 marked windows
Hints:
WindowFromPoint(), GetParent()
GetWindowRect()
DestroyWindow()
SetWindowText(), _stprintf() [sprintf()], TCHAR [char], TEXT()
SetTimer(), WM_TIMER
to get current mouse position:
POINT pt;
GetCursorPos(&pt);
Approximate points:
the main window:
features: 1.0
number of marked windows in the title: 1.0
popup windows:
features: 2.0
appropriate number of popup windows: 1.0
marking one window: 1.5
marking all ancestors: 3.5