Hints For Integrating an Altia Design Into a Microsoft Windows Program for Windows 9x and Windows NT


Integrating an Altia design into an existing windows program can be done without a lot of difficulty. There are 2 fundamental steps: The first is having the Altia runtime draw into a window application's window hierarchy and the second is having the window application share window events with Altia.

Drawing a window:

Altia has an event called "altiaOpenViewId". You send this to event to Altia with the event value being the Windows id of the window you want Altia to draw into. You should create a child window where you can have a window procedure that passes events to Altia (see part 2). The parent of this window needs to have the WS_CLIPCHILDREN flag set.

Before you delete this window you must call "altiaCloseViewId" with the same id. This gives Altia a chance to clean up before the window is deleted. When this window child window is created make sure that WS_CLIPCHILDREN and WS_CLIPSIBLINGS are set.

Sharing events between Altia and the Child window:

The event issue is a little trickier to deal with. There are a couple different solutions. Using Altia library routines to get Altia events is the simplest way to go. But if you are using MFC or some other library's event structure, that might not be possible. The way to get events from Altia is to setup window procedures that will receive either socket or DDE events (depending on which you want to use). When the window procedure notifies you that an event has occurred, you call the appropriate Altia library function to process the event.


Other issues for the windows programmer to deal with are palette and keyboard events.

Palette Events: The Palette issue only applies to displays with 8 bit color. When your main application window gets the focus it will get a WM_PALETTECHANGED event. This event will have to be passed on to Altia so it can maintain the same palette. The application's main window procedure must do a PostMessage to the Altia child window with the message WM_USER+7 and the same parameters as the WM_PALETTECHANGED message.

Keyboard Events: The parent window of the application will get the keyboard events. If the Altia Design requires keyboard input (this is dependent on how you build your objects in Altia, and is optional), these events also need to be passed to Altia. Unlike the WM_PALETTECHANGED event which cannot be passed to Altia directly, the WM_KEYDOWN event can be posted to the altia child window without change.

This is a summary of the issues involved with integrating an Altia design into a Windows application. As you can see, the task will require a programmer familiar with Windows programing. Once the task is complete, any Altia Design can be drawn into a Windows application's windows, providing custom graphics easily and quickly.