Running Programs

When the operating system starts up it restarts any programs which were running when the WPS stopped. The OS2.INI file contains the necessary information to support this. For example, Figure "Running Programs Stored in OS2.INI" shows several running programs.

FolderWorkareaRunningObjects
        D:\OS!2 2.0 DESKTOP\OS!2_SYSTEM\COMMAND_PROMPTS
                WPProgram:A74A6.
        D:\OS!2 2.0 DESKTOP\OS!2_SYSTEM
                WPFolder:DCommand_Prompts.
                WPDrives:DDRIVES.

Running Programs Stored in OS2.INI

The running programs can include programs and workplace objects, such as folders and drives.

The above figure shows two open folders, OS!2_System and its subdirectory COMMAND_PROMPTS. The running programs are stored together with their location so that it is easier to reinstantiate the system as it was left. Refer to the process of opening folders in Folders to understand why this is so.

Abstract Objects

Each abstract object is also stored in the OS2.INI file so it can be located using its reference. In the following example, we can see how a program is stored with its instance data.

PM_Abstract:Objects
        D98F
                ....WPShredder..#..p#...#......
                ....WPAbstract.......Shredder..
                ...........G.WPObject..........
                ...............................
                ..........<WP_SHRED>...........

Abstract Object Reference for Shredder in OS2.INI

This object is the WPS Shredder. It is stored with its Workplace Shell class, OBJECTID, icon description and the classes it inherits from. The hexadecimal pair, D98F, in the upper left corner is the HOBJECT of the shredder. The location of each abstract object is also stored within the folder section of OS2.INI, as can be seen in the example below.

Folder Contents

Folder contents are stored in two places; in the ICONPOS EA file for each directory and in the OS2.INI file as shown below. Any running programs in opened folders are stored under the WorkAreaRunningPrograms section for reinstantiation during the OS/2 initialization, while the FldrContent section below includes all the abstract object references in that folder. These references are also stored, with their window coordinates, in the ICONPOS.EA file of the directory associated with the folder.

PM_Abstract:FldrContent
        5506
               0000  8FD9 0000 AB91 00 00
               0008  1C04 0000 1E7E 00 00
               0010  E13E 0000 22D5 00 00

Abstract Objects Contained in Folder 5506

The hexadecimal numbers are read as pairs, for example 8FD9 is actually D98F. Each pair is a pointer to an abstract object (or program) in the system. Here, we can see that the shredder (D98F) is referenced as the first item in the folder. To help you read this, it is useful to know that

  • 5506 is the HOBJECT for the folder
  • D98F is the HOBJECT of a WPAbstract instance contained in this folder.

    File Associations

    There are two association mechanisms in the OS2.INI file; one for association filters and the other for association types. The format for association types works with the information stored in the settings EAs for each file. If a file doesn't have any EAs then the association is based on its full or partial file name or extension, using the association filter.

    There are two formats for the association filters, depending on whether the program runs in the WPS process or its own process. These trigger the appropriate program when you double click on a data file icon. The first filter, for any file with a .MET extension (metafile), shows that two programs can be used. The first program is described by an OS2.INI program reference (8134). The second program includes the pathname and file name (PICVIEW.EXE).

    The second filter, for a file with a .ICO extension (Icon), also provides a program path and file name (ICONEDIT.EXE).

    PMWP_ASSOC_FILTER
           *.MET
             D:\OS!2 2.0 DESKTOP\OS!2_System\Productivity\WPProgram:A8134.
             D:\OS2\APPS\WPPROGRAMFILE:FPICVIEW.EXE.
           *.ico
             D:\OS2\APPS\WPPROGRAMFILE:FICONEDIT.EXE
    
    
    Association Filters for File Extensions

    The association type uses the same two formats as the filter; we can see the program reference 8134 again for metafiles and ICONEDIT.EXE for bitmaps in the figure below. File types are specified for each data file in its Settings view. We can see five file types below:

  • Metafile
  • Plain text
  • OS/2 command file
  • Executable
  • Bitmap.
    PMWP_ASSOC_TYPE
            Metafile
                    D:\OS!2 2.0 DESKTOP\OS!2_System\Productivity\WPProgram:A8134
            Plain Text
                    D:\OS!2 2.0 DESKTOP\OS!2_System\Productivity\WPProgram:A7660
            OS/2 Command File
                    D:\OS!2 2.0 DESKTOP\OS!2_System\Productivity\WPProgram:A7660
            Executable
                    0000  00                       .
            Bitmap
                    D:\OS2\APPS\WPPROGRAMFILE:FICONEDIT.EXE
    
    
    Association Filters for File Types

    When a user double-clicks on an icon for an object belonging to any of these file types, the program associated with it is started. Note that there is no association for executable files since they themselves are started. The file name association takes precedence over the file type association if both are specified for an object.


    [Back: The OS2.INI File]
    [Next: Multiple Instances of Objects]