When to Use Activate and Suspend Functions
Window functions called during form processing include the window activate function and the window suspend function. Activate and suspend functions let you perform initialization and clean-up when switching between windows. These functions are useful for setting and resetting options and features that only apply to a specific form, menu or window.
Some uses of activate and suspend functions are listed below. This list is not exhaustive. You will find other uses as you develop your applications.
- nYou can change the visual representation of the form, menu or window, to indicate which window is active. For example, you may want to put shadows around the active form and remove shadows from inactive forms, or change the border color of the active form. The form window activate function should display the shadows or redraw the border with the active color, and the form window suspend function should remove the shadows or redraw the border with the inactive color.
- nIf several overlapping forms can be displayed at once, you can change the logical attribute table in use during the time that the form is being processed. This would give the user a visual indication of which form is the active form.
- nYou can use these functions to implement form-specific event tables by specifying a different event table to use for form, memo, or scrollable region processing in the activate function. The default event tables could be restored in the suspend function.
More:
What You Should Not Do in Activate and Suspend Functions
Writing and Installing Window Activate and Suspend Functions