---
rexxpub:
  defaults: rony.yaml
  logo: oorexx
---

<!-- 130_AutoWin_oleinfo_V05.odp (2026-10-15 09:40) -->

<!-- slide # 1 (2026-10-15 09:40) ----------------------------- ODP slide # 1 -->
. slide cover
# Windows-Automatisation 3

. subtitle
**ooRexx Tool "oleinfo": Create HTML OLE Documentation on the Fly**

. cover-art
. picture img/130_AutoWin_oleinfo_V05/p01-diagram-7.png

<!-- slide # 2 (2026-10-15 09:40) ----------------------------- ODP slide # 2 -->
# "oleinfo": Create HTML Documentation

- Information about OLE interfaces sometimes hard to get
. click
- OLE allows querying for information about available
    . after
    - *Methods* and their arguments
    . after
    - *Properties* and their type
    . after
    - *Events* and their arguments
    . after
    - *Constants* and their values

      [*if* the Windows program publishes this information!]{.fragment .afterPrevious}

. click
- **OLEObject** can be used to query published information
    . after
    - Need to supply the **ProgID** or **CLSID**
    . after
    - ooRexx can be used to find all installed **COM** and **OLE** classes with a **ProgID** !

<!-- slide # 3 (2026-10-15 09:40) ----------------------------- ODP slide # 3 -->
# "oleinfo": How to Get Access

. steps each=after
- Included in ooRexx 5.1.0 (released: May 2025), location:
    - **oorexx\\samples\\ole\\oleinfo**
. click
- For older ooRexx versions (ooRexx \< 5.1.0)
    - https://sourceforge.net/p/oorexx/code-0/HEAD/tree/sandbox/rony/oleinfo/
    - Zip-archive: https://wi.wu.ac.at/rgf/wu/lehre/autowin/material/resources
. click
- Utility programs
    - **listProgIds.rex**: list all **ProgId** (optionally **ClsId**) entries in the Windows registry
    - **createOleInfo.rex**: create HTML documentation for the Windows program with the supplied **ProgId**/**ClsId**
    - **getOleConstants.rex**:  create an ooRexx program with the Window program's constants and which can be loaded via the ooRexx `::requires`{.rexx} directive

<!-- slide # 4 (2026-10-15 09:40) ----------------------------- ODP slide # 4 -->
# listProgIds.rex

- Analyzes the Windows registry
. click
- Lists all **COM**/**OLE** classes with a **ProgId**
    . after
    - The result can differ depending on the bitness of ooRexx
        - 32-bit ooRexx will get to see the 32-bit area of the registry
        - 64-bit ooRexx will get to see the 64-bit area of the registry
. click
- Usage (command)

  . after
  ```bash
  rexx listProgIds [0|1]  [fragment]
  ```

    . after
    - Optional: "`0`" (default: show **ProgId** only) or "`1`" (show **CLSID** in addition)
    . after
    - Optional: **ProgId** must contain supplied `fragment` (caseless comparison)

<!-- slide # 5 (2026-10-15 09:40) ----------------------------- ODP slide # 5 -->
# listProgIds.rex

[**rexx listProgIds.rex**]{.fragment .afterPrevious}

. click label
Possible output:

. after group
. file="32-bit ooRexx (maybe):" numbered steps=12,14,15,16,17,18,19,20 each=after
```output

32-bit #    1/2240: ProgId: [AboveLockAppLaunchCallback]
32-bit #    2/2240: ProgId: [AccClientDocMgr.AccClientDocMgr]
32-bit #    3/2240: ProgId: [AccDictionary.AccDictionary]
32-bit #    4/2240: ProgId: [Access.Application]
… cut …
32-bit # 2238/2240: ProgId: [xhtmlfile]
32-bit # 2239/2240: ProgId: [XML]
32-bit # 2240/2240: ProgId: [xmlfile]


Or 64-bit ooRexx (maybe):

64-bit #    1/1902: ProgId: [AADJCSP]
64-bit #    2/1902: ProgId: [ABIT.ABIT]
64-bit #    3/1902: ProgId: [AboveLockAppLaunchCallback]
… cut …
64-bit # 1900/1902: ProgId: [ZeroConfigService.ZDevice]
64-bit # 1901/1902: ProgId: [ZeroConfigService.ZService]
64-bit # 1902/1902: ProgId: [ZipSend.CourierService]
```

. end group

<!-- slide # 6 (2026-10-15 09:40) ----------------------------- ODP slide # 6 -->
# listProgIds.rex

[**rexx listProgIds.rex** *explorer*]{.fragment .afterPrevious}

. click label
Output:

. after group
. file="32-bit ooRexx (maybe):" numbered steps=10,12,13,14,15,16,17 each=after
```output

32-bit #  316/2240: ProgId: [ClassicExplorer.ClassicCopyExt]
32-bit #  317/2240: ProgId: [ClassicExplorer.ExplorerBand]
32-bit #  318/2240: ProgId: [ClassicExplorer.ExplorerBHO]
32-bit #  319/2240: ProgId: [ClassicExplorer.ShareOverlay]
32-bit #  755/2240: ProgId: [InternetExplorer.Application]
32-bit # 1561/2240: ProgId: [Shell.Explorer]


Or 64-bit ooRexx (maybe):

64-bit #  306/1902: ProgId: [ClassicExplorer.ClassicCopyExt]
64-bit #  307/1902: ProgId: [ClassicExplorer.ExplorerBand]
64-bit #  308/1902: ProgId: [ClassicExplorer.ExplorerBHO]
64-bit #  309/1902: ProgId: [ClassicExplorer.ShareOverlay]
64-bit #  665/1902: ProgId: [InternetExplorer.Application]
64-bit # 1273/1902: ProgId: [Shell.Explorer]
```

. end group

<!-- slide # 7 (2026-10-15 09:40) ----------------------------- ODP slide # 7 -->
# createOleInfo.rex

. after
- Creates an **OLEObject** instance from the **ProgId** or **CLSID**
. after
- Queries all interfaces for **methods**, **properties**, **events** and **constants**
. after
- Creates an HTML text file
. after
- Displays the results in the default web browser
. click
- Usage (command)

  . after
  ```bash
  rexx createOleInfo.rex ProgId | CLSID [0|1] [0|1]
  ```

    . after
    - **ProgId** or **CLSID** (either must be supplied)
    . after
    - Optional: "`0`" (default: long format) or "`1`" (short reference format)
    . after
    - Optional: "`0`" (do not display result) or "`1`" (default: display result in web browser)

<!-- slide # 8 (2026-10-15 09:40) ----------------------------- ODP slide # 8 -->
# createOleInfo.rex

. after steps
- `createOleInfo.rex` can be called from within a ooRexx program
    - The first argument is an OLEObject object returned by a Windows program
    . after
    - Allows one to document OLE objects for which no **ProgId** may exist
- Usage from within an ooRexx program

  . after
  ```
  call createOleInfo.rex OleObject, [Title], [0|1], [0|1]
  ```

    - **OleObject**
    . after
    - Optional **Title** (an informative string) for the generated HTML document
    . after
    - Optional: "`0`" (default: long format) or "`1`" (short reference format)
    . after
    - Optional: "`0`" (do not display result) or "`1`" (default: display result in web browser)

<!-- slide # 9 (2026-10-15 09:40) ----------------------------- ODP slide # 9 -->
# createOleInfo.rex, 3a

**rexx createOleInfo.rex** *InternetExplorer.Application*

. click picture img/130_AutoWin_oleinfo_V05/p09-8.png width=58%

<!-- slide # 10 (2026-10-15 09:40) --------------------------- ODP slide # 10 -->
# createOleInfo.rex, 3b

**rexx createOleInfo.rex** *InternetExplorer.Application*

. layers style=width:100%
. picture img/130_AutoWin_oleinfo_V05/p10-layer-13.png id=#p10L1

. after picture img/130_AutoWin_oleinfo_V05/p10-layer-14.png id=#p10L2

. after picture img/130_AutoWin_oleinfo_V05/p10-layer-15.png id=#p10L3

. after picture img/130_AutoWin_oleinfo_V05/p10-layer-16.png id=#p10L4

. after picture img/130_AutoWin_oleinfo_V05/p10-layer-17.png id=#p10L5

. end layers

<!-- slide # 11 (2026-10-15 09:40) --------------------------- ODP slide # 11 -->
# createOleInfo.rex, 4

**rexx createOleInfo.rex** *InternetExplorer.Application **1***

. click picture img/130_AutoWin_oleinfo_V05/p11-18.png width=82%

<!-- slide # 12 (2026-10-15 09:40) --------------------------- ODP slide # 12 -->
# getOleConstants.rex

. after steps
- Creates an ooRexx program that contains all published constants
    - Program saves all constants in the **.local** directory with the index **OLE.CONST**
        . after
        - Any entry in **.local** or **.environment** can be referenced with an environment symbol
            . after
            - **.ole.const** returns therefore the stringtable with the saved OLE constants
    . after
    - Sending the name of the constant to **.ole.const** returns its value
        . after
        - E.g. `.ole.const~RGBBROWN` may return the value `2763429` for Excel
    . after
    - It is possible to require different generated constant programs
        - All constants will always be saved in a stringtable named **.ole.const**
. after
- Usage (command)

  . after
  ```bash
  rexx getOleConstants.rex ProgId | CLSID [filename]
  ```

    . after
    - **ProgId** or **CLSID** (either must be supplied)
    . after
    - Optional: **filename** to store the generated Rexx program, otherwise writes to **stdout**

<!-- slide # 13 (2026-10-15 09:40) --------------------------- ODP slide # 13 -->
# getOleConstants.rex

- Example

  . click id=#cmd
  ```bash
  rexx getOleConstants.rex Excel.Application constExcel.rex
  ```

    . after
    - Queries Excel for all its published constants
    . with
    - Creates a Rexx program that stores all constants into the `.ole.const` **stringtable**
    . with
    - Saves that Rexx program in a file named **constExcel.rex**

      . click id=#req
      ```rexx
      /* demonstrate how to access an Excel constant */
      say "Excel constant for the color brown:" .ole.const~RgbBrown /* yields: 2763429 */

      ::requires "constExcel.rex"   -- make Excel constants available via .ole.const
      ```

      . after arrow #cmd:1:"constExcel.rex" -> #req:4:"constExcel.rex"

    . click
    - Any ooRexx program can then require **constExcel.rex** and access `.ole.const`

      . click label
      Possible Output:

      . after
      ```output
      Excel constant for the color brown: 2763429
      ```

<!-- slide # 14 (2026-10-15 09:40) ----------- business card (not in the ODP) -->
. slide card logo=none
# Contact