A method and system for controlling the execution of an application program

Abstract: A method and system for controlling the execution of an application program to effect the performing of a specialized task is provided. In preferred embodiments, an interface computer program gathers status information from the application computer program, collects user input relating to the specialized task, generates commands to send to the application program, and sends the commands to the application program to effect the execution of the specialized task. The interface computer program communicates with the application computer program preferably through the dynamic data exchange of Windows.

Description: Technical Field This invention relates generally to methods for controlling the execution of an application program, and more specifically a method for providing a user interface for controlling the performing of specialized tasks by the application program. Background of the Invention There currently exists a plethora of general-purpose application computer programs. These general-purpose application programs include word processors, desk top publishers, spreadsheets, and data base products. The field is very competitive for producing these products. When these general-purpose application programs were first developed for personal computers, they were unsophisticated by today's standards. Due in part to competitive pressures, these programs evolved into very sophisticated programs that provide many features and options. For example, the original spreadsheet products basically provide a grid of cells for numerical calculations. Spreadsheet products today provide many more capabilities such as graphing data, storing and retrieving data, and programming functions. Unfortunately, as these general-purpose application programs get more sophisticated, the user also needs to be more sophisticated to take advantage of advanced features. These advanced features often make tasks that were previously simple more complicated to perform. Consequently, users must devote a considerable amount of time to learning the product to perform these previously simple tasks. This complexity also affects the efficiency of tasks that are performed for the first time on an infrequent basis. For example, a user may want to quickly produce a quarterly newsletter using a desktop publishing product, but the user may not have design skills or skills in using all the necessary parts of the application. Also, a user may produce a quarterly newsletter using a desktop publishing product. However, the user may forget how to use many of the features of the publisher in between issues of the newsletter. Thus, the user must spend a certain amount of re-learning time each quarter. A feature that has recently been added to several general-purpose computer programs is interprocess communications. Interprocess communications allows computer programs to transmit data to each other through communications channels. Interprocess communications has typically been used to synchronize programs, to request data from a program, and send data to a program. Microsoft Corporation has developed a standard interprocess communications mechanism for application programs. The mechanism is called the Dynamic Data Exchange (DDE). The DDE provides a means for interprocess communications for programs that are developed for the Windows windowing environment. The DDE feature of Windows is described in the "Microsoft Systems Journal," November, 1987 and the "Microsoft Windows Programmer's Reference." The DDE is implemented through message passing. The DDE is typically used to allow two application programs to share data. For example, a user may want to incorporate a quarterly chart that is developed in a graphics package into a newsletter. Using DDE, the publisher product could request a new chart to be generated by the graphics product. The publisher product could then automatically incorporate the new chart into the current newsletter. The DDE thus provides a mechanism for one program to share and update data with another program. Typically, developers of application programs that use the DDE will publish their DDE interface. For example, the developer of a spreadsheet product will publish a list of messages that it will recognize and how it will respond to those messages. Some general-purpose application programs define these messages so that each function that can be accomplished through the user interface to the application program can be accomplished through the DDE. IBM Technical Disclosure Bulletin, Vol. 33, No. 6A, November 1990, Armonk, NY, US, pp. 483 - 485 "Architecture For Separate User-Interface Software Development" discloses an architecture for separate user-interface software development. The document describes a run time environment consisting of an application process and an user-interface process. When a user invokes a command, messages are sent to the application process causing execution of a desired command. The user interface process also queries the application process to determine application state data. The user cannot perceive that more than one process is used although both processes may be installed as programs separately from each other. It is the object of the invention to provide a method for performing a desired task in an application computer program allowing a user to work with sophisticated general-purpose programs in an easy-to-use way. This object is solved by the subject matter of independent claim 1. Preferred embodiments are defined in the dependent claims. The invention is advantageous in that it provides a method for performing a specialised task in a general-purpose application program. The invention is further advantageous in that it provides a new user interface to a pre-existing application program to control the execution of a task. Further, the invention is advantageous in that it provides a method that allows third parties to extend and customise features of an existing application program. The invention additionally is advantageous in that it provides an interface program that has expert knowledge relating to the performance of a specialised task. Brief Description of the Drawings Figure 1A is a block diagram of an application program and an interface program. Figure 1B illustrates a user interface program that interacts with two application programs. Figure 2 is a flow diagram of typical communication sequence between an interface program and an application program Figure 3 shows a display for the Calendar PageWizard. Figure 4 is a flow diagram of the main window procedure for a PageWizards. Figure 5 is a flow diagram of the message processing procedure for the PageWizard main window. Figure 6 is a flow diagram of the procedure GoPage. Figure 7 is a flow diagram of a preferred window procedure for a page. Figure 8 is a flow diagram of the AskPublisher procedure. Figure 9 is a flow diagram of the TellPublisher procedure. Detailed Description of the Invention The present invention provides methods for implementing a user interface to one or more application programs. According to the methods, an interface program interacts with an application program and a user to effect the performance of a desired task. An interface program is referred to as a wizard. For example, in one embodiment of the present invention, several user interface programs, called PageWizards, provide new user interfaces to a desktop publishing application program, called Publisher. Each PageWizard provides a user interface to perform a specific task with the Publisher. One such PageWizard, called Calendar PageWizard, supports creating calendars. The Calendar PageWizard collects formatting and date information from the user. The Calendar PageWizard interacts with the Publisher to effect the creation of a calendar by Publisher. Figure 1A is a typical block diagram of an application program 102 and an interface program 101. The programs communicate through interprocess communications channel 105. In a preferred embodiment, interprocess communications channel is the Dynamic Data Exchange (DDE) of Windows. However, other methods of interprocess communications are acceptable. The interface program 101 comprises a user interface portion 104 and an application interface portion 103. The user interface portion 104 provides the user with a task-specific interface. In the example of Calendar PageWizard, the task is to use the Publisher to create calendars. The user interface displays calendar information to the user and collects formatting data from the user. The application interface portion 103 prepares commands to send to the application program 102 and controls communications with the application program 102. Alternatively, an interface program may interact with several application programs to effect a specific task. For example, a user interface program may support a mail merge. Such a user interface program could interact with a data base application program and a word processing application program. The mail merge interface program would collect names and addresses from the data base product based on user-entered criteria and send the data to a word processing program to merge with a user-entered document. Figure 1B illustrates a user interface program that interacts with two application programs. The interface program 111 has a user interface portion 114 and two application interface portions 115, 116. Each application interface portion interfaces with one of the application programs 112, 113 through one of the interprocess communications channels 117, 118. Figure 2 is a flow diagram of typical communication sequence between an interface program and an application program. The blocks in the right column 210 represent processing that is performed by the application program. The blocks in the left column 220 represent processing that is performed by the interface program. Initially, the application program is started. The user of the application program selects to start the interface program. In block 211, the application programs starts the selected interface program. In other embodiments, the user could start an interface program which would then start the application program or both the application program and the interface program could be started independently of each other. In block 221, the interface program creates status commands. These status commands request the application program to send status information to the interface program. In block 222, the interface program sends the status commands to the application program. In block 212, the application program processes the status commands. In block 213, the application program sends the status to the interface program. In block 223, the interface program inputs data from the user describing the task to be performed. In block 224, the interface program creates task commands to perform the desired task. In block 225, the interface program sends the task commands to the application program. In block 214, the application program executes the task commands. In a preferred embodiment, the application program and interface program operate in the Windows windowing environment. The interface program provides windows through which to display information to the user and receive information from the user. Figure 3 shows a display for the Calendar PageWizard, which interfaces with the Publisher application program. PageWizards interface with the user through a series of "pages." The user "navigates" through these pages to input and view data. Window 301 is the main Publisher window. Window 302 is the main PageWizard window, which overlays window 301. Window 302 comprises page-specific controls 303, a graphic item 304, and main navigation controls 305. The main navigation controls 305 allow the user to select the various pages that the Calendar PageWizard provides. The "Next >" control 306 indicates to go to the next page. The "<" control 307 indicates to go to the previous page. The "|<<" control 308 indicates to go to the first page. The "Cancel" control 309 indicates to exit the Calendar PageWizard and return to the Publisher. The pages are defined in a page resource file with user-defined resources. For each page, the resource file contains the following information: where n in PAGEn specifies the page number, NextPageNum specifies the page to be displayed when the next page is selected, and cControls is the count of the control information lines that follow. The format of the control information lines is controltype, text, id, x, y, width, height, nextpage where the format is same as the standard dialog controls except for the item nextpage. The item nextpage specifies the next page to go to when the control is selected. This allows the navigation sequence of the pages to vary based on the control the user selects. The graphics for the pages are defined in a resource file with user-defined resource items. There are two types of graphic items: a metafile and a text object. Each graphic item has an entry in the graphics resource file. The format for the metafile entry is where grname.wmf specifies the name of the associated metafile (each metafile is stored in a separate file) and variables x, y, width, and height specify the positioning of the metafile on the page. The format for a text object entry is where stringID contains the id of a string that is stored in a string resource file. The string resource file contains stringID and the associated text string. The other variables define the position and display characteristics of the string. In a preferred embodiment, all wizards that interact with a certain application program share common architectural features. For example, all wizards that interface with the Publisher use pages as described above. A PageWizard has a main window procedure and a window procedure for each page. The main window procedure sends messages to the pages to control the navigation through the pages. Figure 4 is a flow diagram of the main window procedure for a PageWizards. In block 401, the procedure opens the communications channel with the application program. In another embodiment, the communications channel is opened just before the first communications data is sent. In block 402, the procedure initializes an internal data structure with display information from the resource files. In block 403, the procedure requests and receives status information from the application program. In block 404, the procedure creates the main window. In blocks 405 and 406, the procedure executes the main message loop. The procedure waits for a message and then dispatches the message. Figure 5 is a flow diagram of the main window procedure for the PageWizard. This procedure displays the main window, processes the termination character, controls the navigation through the pages, and handles other miscellaneous windowing functions. Blocks 510, 520, 530, 540, 550, and 560 decode the message. In block 510, if the message is a WM_CREATE, then the procedure displays the main window in block 511 through 513. In block 511, the procedure adjusts the system menu by removing non-applicable menu commands and adding an "Abort..." menu command. In block 512, the system determines the appropriate font based on the video configuration, and then scales the size of the main PageWizard window based on the size of this font. In block 513, the procedure displays the main window and returns. In block 520, if the message is WM_CHAR, then the procedure continues at block 521. In block 521, if the WM_CHAR message indicates that the escape key was pressed, then the procedure effects the exiting of the PageWizard. In block 530, if the message is a WM_COMMAND, a WM_ENTERPAGE, or a WM_LEAVEPAGE message, then the procedure continues at block 531. In block 531, if the message is for a main navigation control, then the procedure continues at block 535, else the procedure continues at block 532. In block 532, the procedure passes the message to the window procedure for the page currently displayed. Each page has a corresponding window procedure to handle the messages for that page. In block 533, the procedure updates a variable to track the current page. In block 534, the procedure enables or disables the navigation controls to reflect whether there is no next page or no previous page and returns. In block 535, the procedure calls procedure GoPage (described below), which effects the switching of pages and returns. In block 540, if the message is WM_PAINT, then the procedure continues at block 541. In block 541, the procedure paints the main PageWizard window and returns. In block 550, if the message is WM_CLOSE, then the procedure continues at block 551. In block 551, the procedure exits the PageWizard. In block 560, if the message is WM_SYSCOMMAND, then the procedure continues at block 561. In block 561, the procedure displays the about dialog box and returns. Figure 6 is a flow diagram of the procedure GoPage. This procedure receives a page number and effects the changing from the current page to the received page. In block 601, if the received page number is valid, then the procedure continues at block 602, else the procedure returns. A page number is valid if it is defined in the page resource file. In block 602, the procedure sends a WM_LEAVEPAGE message to the previous page. In block 603, the procedure saves the previous page in a list of previous pages. This list is used to navigate through previous pages. In block 604, the procedure destroys the controls of the previous page. In block 605, the procedure creates the controls for the new page. In block 606, the procedure sends a WM_ENTERPAGE message to the window procedure for the new page. Figure 7 is a flow diagram of a preferred window procedure for a page. In a preferred embodiment, the page windows are architecturally similar in the way they handle navigation controls. In block 710, if the message is WM_ENTERPAGE, then the procedure continues at block 711. The WM_ENTERPAGE message is sent from the procedure GoPage. In block 711, the procedure draws the graphics objects for the page. In block 712, the procedure initializes the controls. In block 713, the procedure perform page-specific initialization and returns. In block 720, if the message is WM_COMMAND, then the procedure continues at block 721. The WM_COMMAND message is sent from the procedure GoPage. In block 721, the procedure updates page-specific controls. In block 722, the procedure updates page-specific graphics. In block 723, the procedure performs page-specific processing and return. In block 730, if the message is WM_LEAVEPAGE, then the procedure continues at block 731. The WM_LEAVEPAGE message is sent by the procedure GoPage. In block 731, the procedure validates the user-entered page data. In block 732, the procedure removes page-specific graphics from the display. In block 733, the procedure performs page-specific processing and returns. In a preferred embodiment, the application interface portion of the interface program controls the gathering of status information from the application program, the creating of task commands, and the sending of the task commands to the application program. The application interface code creates the task commands based on the user-entered information and status information supplied by the application program. For Calendar PageWizards, the application interface generates task commands to create a calendar in the Publisher based on the user data and designs built into Calendar PageWizards. The user data specifies size, font, date, arrangement, and other options for calendar creation. In a preferred embodiment, the application interface communicates with the application program through the dynamic data exchange (DDE) facilities of Windows. The interface program functions as a DDE client to the application program, which functions as a DDE server. The interface program initiates a conversation with the application program by sending a DDE_INITIATE message specifying the application and topic. The application program responds with a DDE_ACK message. To request status information, the interface program sends a DDE_REQUEST message with the item to the application program. The application program responds with a DDE_DATA message with the requested item. The interface program sends a request for each item it needs from the application program. The interface program sends commands to the application program by sending a DDE_EXECUTE message with the command to the application. The application program returns a DDE-ACK message when it completes processing the command. If the interface program interacts with multiple application programs, then this communications occurs with each application program. Figures 8 and 9 show flow diagrams of procedures that support the DDE communications in PageWizards. Figure 8 is a flow diagram of the AskPublisher procedure. The AskPublisher procedure opens the DDE channel if not already open and requests status information from the Publisher. This procedure receives as input parameter the item to request from the Publisher. In block 801, if the DDE channel is not open, then the procedure opens the channel in block 802 (as described above) and continues at block 803. In block 803, the procedure sends a DDE_REQUEST message with the item to the Publisher. In block 804, the procedure waits for a DDE_DATA or DDE_ACK message to be received from the Publisher. This waiting ensures that Publisher will process the request before AskPublisher returns to the invoking routine. In block 805, if the DDE_ACK message indicates an error, then the procedure reports the status to the user in block 806. The procedure then returns. Figure 9 is a flow diagram of the TellPublisher procedure. The TellPublisher procedure opens the DDE channel if not already open and send commands to execute to the Publisher. This procedure receives as input parameter the command to send to the Publisher. In block 901, if the DDE channel is not open, then the procedure opens the channel in block 902 (as described above) and continues at block 903. In block 903, the procedure sends a DDE_EXECUTE message with the item to the Publisher. In block 904, the procedure waits for the DDE_ACK message to be received from the Publisher. This waiting ensures that Publisher will process the command before TellPublisher returns. In block 905, if the DDE_ACK message indicates an error, then the procedure reports the status to the user in block 906 and returns.

Claims: Method for performing a selected task in an application computer program (102, 112, 113), the application program having a plurality of commands for controlling execution of the application program and being provided with a command interface which can be invoked via a predefined interprocess mechanism, the method comprising the computer-implemented steps of: executing the application program and an interface computer program (101, 111) concurrently and separately from each other, each program generating a separate screen display (301, 302), the interface program comprising a user interface portion (104, 114) capable of displaying a task specific interface comprising one or more pages arranged to allow a user to input and view data related to the selected task, the interface program further comprising an application interface portion (103, 115, 116) arranged to control communication with the application program via said predefined interprocess communication mechanism (105, 117, 118); generating (221) in the interface program status commands for requesting that status information for the application program be sent from the application program to the interface program, and sending (222) the generated status commands to the application program; processing (212) in the application program, the received status commands to gather status information, and sending (213) the gathered status information to the interface program; receiving (223) in the interface program via said task specific interface a user request from the user to perform the selected task; using the received status information and the received user request to identify (224) in the interface program task commands of the application program required to perform the selected task, and sending (225) the identified task commands to the application program; and executing (214) the received task commands to effect the performing of the selected task. Method of claim 1 wherein the interface program and the application program execute in a windowing environment. Method of claim 1 or 2 wherein the step of executing the application program is started under control of the interface program. Method of claim 1 or 2 wherein the step of executing the interface program is started (211) under control of the application program. Method of claim 1 or 2 wherein the application program and the interface program are started independently. Method of one of claims 1 to 5 wherein the interface program is provided with further application interface portions, each interfacing with a further application program, the method further comprising the step of executing said application programs, each being provided with a command interface, wherein the steps of sending the status commands, the status information and the task commands are carried out for each application program; and the task commands are identified for each application program. Method of claim 6, wherein the interface program is capable of receiving data from one of said application programs and sending said data to another application program. Method of one of claims 1 to 7, wherein the task specific interface of the interface program comprises a plurality of pages and navigation controls (305) to allow the user to navigate through said pages.

Inventors: LINNETT BARRY JAMES, MARTIN FORD, LINNETT, BARRY JAMES, MARTIN, FORD
Applicants: MICROSOFT CORP, MICROSOFT CORPORATION
Application year: 1992
Main classification: G06F9
IPC codes: G06F3, G06F9