OWLNext 7.0
Borland's Object Windows Library for the modern age
|
When both a child window and the parent window are created in an ObjectWindows application, communication between the parent and child windows is in place.
But you can also prepare your DLL for use by non-ObjectWindows applications.
When a child window is created in an ObjectWindows DLL and the parent window is created by a non-ObjectWindows application, the parent-child relationship must be simulated in the ObjectWindows DLL. This is done by constructing an alias window object in the ObjectWindows DLL that is associated with the parent window whose handle is specified on a DLL call.
In the following code, the exported function CreateDLLWindow is in an ObjectWindows DLL. The function will work for both ObjectWindows and non-ObjectWindows applications.
CreateDLLWindow determines if it has been passed a non-ObjectWindows window handle by the call to GetWindowPtr, which returns 0 when passed a non-ObjectWindows window handle. If it is a non-ObjectWindows window handle, an alias parent TDialog object is constructed to serve as the parent window.