NextPrevUpTopContentsIndex

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 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 the "Prompting for Input" chapter in the LispWorks CAPI User Guide .

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 MS Windows.

Example

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.


LispWorks CAPI Reference Manual - 25 Jul 2006

NextPrevUpTopContentsIndex