Krzysztof Mossakowski
Windows Programming
2006 - Tasks
Windows, mouse and keyboard
Mouse tracking
Demonstration
4 windows tracking current mouse position:
positioned as in the demonstration
do not let to move one of these windows independently
system menu (Alt+Space or right click on a taskbar)
transparency
default: ca. 50%
'+' key: increasing the transparency, '-' key: decreasing the transparency
mouse cursor :
NS or WE sizing (see the demonstration)
background color - system color of active window's caption
always on top
only one window visible on the taskbar and in Alt+Tab window
dragging using left mouse button: changing of windows' sizes (see the demonstration)
when the Scroll Lock key is turned on stop tracking the mouse
Hints:
transparency:
#define _WIN32_WINNT 0x0500
przed
#include <windows.h>
WS_EX_LAYERED
SetLayeredWindowAttributes()
WM_TIMER
WM_MOVING
GetCursorPos(), WM_LBUTTONDOWN, WM_LBUTTONUP, WM_MOUSEMOVE, SetCapture()
WM_SETCURSOR, SetCursor(), LoadCursor()
GetKeyState(), WM_CHAR
Approximate points:
4 windows: 1.0
positions and changing of the size: 2.0
tracking the mouse cursor (also checking the state of Scroll Lock key): 2.5
preventing from moving windows independently: 0.5
system menu : 0.5
background color: 0.5
always on top: 0.5
only on window visible on the taskbar: 0.5
transparency (also changing of transparency): 2.0