All Manuals > CAPI User Guide and Reference Manual > 21 CAPI Reference Entries

make-foreign-owned-interface Function

Summary

Creates a dummy interface which allows another application's window to be the owner of a CAPI dialog.

Package

capi

Signature

make-foreign-owned-interface &key handle name => interface

Arguments
handle
A Microsoft Windows hwnd.
name
A string naming interface.
Values
interface
An instance of foreign-owned-interface.
Description

The function make-foreign-owned-interface creates an instance of foreign-owned-interface. interface can be used as the owner argument when displaying a dialog. For information about dialog owners, see 10 Dialogs: Prompting for Input.

handle must be supplied and is the window handle (Windows hwnd) of a window in some application. For a CAPI window this window handle can be obtained by simple-pane-handle. For non-CAPI applications, the method of finding the window handle will depend on the language and the way windows are represented, so you should consult the appropriate documentation.

name becomes the name of interface, and has no other meaning.

make-foreign-owned-interface is implemented only on Microsoft Windows.

Examples

This example shows how a CAPI window can be the owner of a dialog in another LispWorks image.

Start LispWorks for Windows.

  1. In the Listener, do Tools > Interface > Listen. This puts the Listener interface in the value of *.
  2. In the Listener enter (capi:simple-pane-handle *). The returned value is the window handle, it should be an integer. Denote this value by hwnd.

Start another LispWorks for Windows image (do not quit the first image). In the Listener of this second LispWorks image:

  1. Enter (setq foi (capi:make-foreign-owned-interface :handle hwnd)).
  2. Enter (capi:prompt-for-color "Color?" :owner foi).

Now note that the Color dialog is owned by the Listener of the first LispWorks image.


CAPI User Guide and Reference Manual (Macintosh version) - 01 Dec 2021 19:31:27