OWLNext 7.0
Borland's Object Windows Library for the modern age
|
This TFrameWindow constructor is used to connect an existing interface element to a new TFrameWindow object.
This object is known as an alias for the existing window.
Parameter | Explanation |
hWnd | The window handle of the existing interface element. This is the window the TFrameWindow object controls. |
module | Passed to the base class constructor as the TModule parameter for that constructor. This parameter defaults to 0. |
This version of the constructor is useful for creating window objects for existing windows. You can then manipulate any window as if it were an ObjectWindows-created window. This is useful in situations such as DLLs, when a non-ObjectWindows application calling into the DLL passes in an HWND. You can then construct a TFrameWindow alias for the HWND and call TFrameWindow member functions as you normally would.
The following example shows how to construct a TFrameWindow for an existing interface element and use that window as the main window:
When you use this constructor for TFrameWindow, it sets the flag wfAlias. You can tell whether a window element was constructed from its window object or whether it's actually an alias by calling the function TWindow::IsFlagSet() with the wfAlias flag. For example, suppose you do not know whether the function AddWindow in the last example has executed yet. If your main window is not an alias, AddWindow has not executed. If your main window is an alias, AddWindow has executed.