7.4 Exercises

Solutions to these exercises are supplied in Section B.2.2

  1. Describe Figure 7-6, a state diagram that describes the states and transitions between states for a window, as used in Microsoft Windows. Identify the states and transitions shown in the diagram.

    Figure 7-6. States and transitions for a window
    figs/Luml_0706.gif
  2. Update Figure 7-6 stepwise to show the following details. After each step, check your answers against the solutions shown in Appendix B:

    1. If a window receives a Restore event, indicating that the window should be restored or displayed, as one of many windows taking a portion of the space on the user screen, and the window is in the Minimized or Maximized state, it will be changed to the Restored state.

    2. If a window receives a Minimize event, indicating that the window should be minimized or displayed as an icon taking a minimal amount of space on the user screen, and the window is in the Restored or Maximized state, it will be in the Minimized state.

    3. If a window receives a Maximize event, indicating that the window should be maximized or displayed as the only window taking all the space on the user screen, and the window is in the Minimized or Restored state, it will be in the Maximized state.

    4. Every time a window is being restored or maximized it performs a Redraw action to render itself.

    5. Every time a window is being minimized it requests that the OS reduce its application priority using the LowPriority action so that other restored or maximized application windows can have more of the computer's power. The LowPriority action requires that the ApplicationID argument be passed to it so that the operating system can identify the application whose priority is lower.