The Threads demo, shown in Figure 14.3, puts into code some of the ideas explained in this chapter. It creates four secondary threads, each of which draws randomly shaped and colored rectangles in a child window until the program ends. The top of the window contains a list box showing information about all four threads. By selecting a thread and choosing a menu command, you can suspend, resume, and change the priority of any thread. From the Options menu, you can also activate a mutex so only one thread draws at a time.
Figure 14.3: The Threads demo
NOTE
The Threads demo is included on the CD accompanying this book, in the Chapter 14 folder.