Function SetAppWindow() Foundation
Sets or returns the application window.
SetAppWindow( [<oXbp>] ) --> oOldWindow
The return value of SetAppWindow() is the window that was passed to the function. If no window is passed, the return value is either NIL (text-mode application), or it is identical with the return value of AppDesktop() (GUI application).
The function SetAppWindow() is called by default at start-up of a program within APPSYS.PRG and determines the default application window. This window is not explicitly referenced in a memory variable but can be retrieved any time in a program by calling this function.
The application window serves as default parent for all Xbase Parts that are created without a specific parent.
If an XbpCrt window is used as application window (hybrid application), it becomes the output device for text-mode screen output. This affects functions like QOut() or DispOut(), for example. In this case it must be emphasized that only one XbpCrt window can have output focus for text-oriented screen output. If multiple XbpCrt windows are required for such output, the desired window must be passed to SetAppWindow() prior to calling an output function.
For device-specific text output, like @...SAY or DevOut(), an XbpCrt window becomes the output device only if SET DEVICE TO SCREEN is set when calling SetAppWindow(). If the printer is defined as output device using SET DEVICE TO PRINTER device-specific output is still directed to the printer.
If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.