Host Display InfoAvailability LightWave® 6.0 The host display global returns platform-specific information about LightWave®'s interface. This is primarily useful when you want to create a platform-dependent interface for your plug-in. Global Call HostDisplayInfo *hdi; hdi = global( LWHOSTDISPLAYINFO_GLOBAL, GFUSE_TRANSIENT ); The global function returns a pointer to a HostDisplayInfo, or NULL if called in a non-interactive (e.g. Screamernet) context. typedef struct st_HostDisplayInfo {
#ifdef _MSWIN
HANDLE instance;
HWND window;
#endif
#ifdef _XGL
Display *xsys;
Window window;
#endif
#ifdef _MACOS
WindowPtr window;
#endif
} HostDisplayInfo;
The operating system #defines (_MSWIN, _XGL, _MACOS) are discussed in the section on plug-in compiling.
Example This code fragment displays everyone's favorite first message, but using the Win32 MessageBox function with LightWave®'s main window handle as the parent window. #include <lwserver.h>
#include <lwdisplay.h> /* includes windows.h under Windows */
HostDisplayInfo *hdi;
hdi = global( LWHOSTDISPLAYINFO_GLOBAL, GFUSE_TRANSIENT );
if ( hdi ) {
MessageBox( hdi->window, "Hello, world!", "My Message", MB_OK );
}
|