PURPOSE: To eliminate competition of printing and cleaning treatments by controlling whether the cleaning treatment is conducted or not on the basis of information obtained by obtaining means of the information for indicating a printing state when the cleaning treatment of a head is instructed.
CONSTITUTION: Whether click information of a key code or a mouse cursor input from a keyboard is obtained or cancelled is decided. In the case of cancel, a print mode is finished. In the case except the cancel, whether a cleaning button is selected or not is decided. In the case of the button, a button color is unhighlighted so as not to select a print and execution button, and the button is again highlighted after a cleaning treatment. When the case except the cleaning button is decided, whether the print and execution button is decided, and in the case of the execution button, the cleaning button is unhighlighted, and then highlighted after a printing treatment is conducted. It is shifted to a treatment for scanning next key.