Access to process properties

Additionaly, subroutines my_type(), process_entry() and file_type(file), get_title() and set_title(newtitle) are implemented. my_type() returns the type of the current process (one of "FS", "DOS", "VIO", "PM", "DETACH" and "UNKNOWN"), or undef on error.

file_type(file)

returns the type of the executable file file, or dies on error. The bits 0-2 of the result contain one of the values

T_NOTSPEC (0)

Application type is not specified in the executable header.

T_NOTWINDOWCOMPAT (1)

Application type is not-window-compatible.

T_WINDOWCOMPAT (2)

Application type is window-compatible.

T_WINDOWAPI (3)

Application type is window-API.

The remaining bits should be masked with the following values to determine the type of the executable:

T_BOUND (8)

Set to 1 if the executable file has been "bound" (by the BIND command) as a Family API application. Bits 0, 1, and 2 still apply.

T_DLL (0x10)

Set to 1 if the executable file is a dynamic link library (DLL) module. Bits 0, 1, 2, 3, and 5 will be set to 0.

T_DOS (0x20)

Set to 1 if the executable file is in PC/DOS format. Bits 0, 1, 2, 3, and 4 will be set to 0.

T_PHYSDRV (0x40)

Set to 1 if the executable file is a physical device driver.

T_VIRTDRV (0x80)

Set to 1 if the executable file is a virtual device driver.

T_PROTDLL (0x100)

Set to 1 if the executable file is a protected-memory dynamic link library module.

T_32BIT (0x4000)

Set to 1 for 32-bit executable files.

file_type() may croak with one of the strings "Invalid EXE signature" or "EXE marked invalid" to indicate typical error conditions. If given non-absolute path, will look on PATH, will add extention .exe if no extension is present (add extension . to suppress).

process_entry()

returns a list of the following data:

Title of the process (in the Ctrl-Esc list);

window handle of switch entry of the process (in the Ctrl-Esc list);

window handle of the icon of the process;

process handle of the owner of the entry in Ctrl-Esc list;

process id of the owner of the entry in Ctrl-Esc list;

session id of the owner of the entry in Ctrl-Esc list;

whether visible in Ctrl-Esc list;

whether item cannot be switched to (note that it is not actually grayed in the Ctrl-Esc list));

Although there are several other program types for WIN-OS/2 programs, these do not show up in this field. Instead, the PROG_VDM or PROG_WINDOWEDVDM program types are used. For instance, for PROG_31_STDSEAMLESSVDM, PROG_WINDOWEDVDM is used. This is because all the WIN-OS/2 programs run in DOS sessions. For example, if a program is a windowed WIN-OS/2 program, it runs in a PROG_WINDOWEDVDM session. Likewise, if it's a full-screen WIN-OS/2 program, it runs in a PROG_VDM session.

set_title(newtitle)

- does not work with some windows (if the title is set from the start). This is a limitation of OS/2, in such a case $^E is set to 372 (type