November 1998
Intermediate to advanced
1520 pages
37h 53m
English
A window procedure normally receives mouse messages only when the mouse cursor is positioned over the client or nonclient area of the window. A program might need to receive mouse messages when the mouse is outside the window. If so, the program can “capture” the mouse. Don’t worry: it won’t bite.
To examine why capturing the mouse might be necessary, let’s look at the BLOKOUT1 program shown in Example 7-6. This program may seem functional, but it has a nasty flaw.
Example 7-6. The BLOKOUT1 program.
BLOKOUT1.C /*----------------------------------------- BLOKOUT1.C -- Mouse Button Demo Program (c) Charles Petzold, 1998 -----------------------------------------*/ #include <windows.h> LRESULT CALLBACK WndProc ...