WINDOWGHOSTING property (System)
Description
Specifies if “Window Ghosting” is active for the current Presentation Server instance.
Property Value
This property is boolean value. It returns TRUE$ if Window Ghosting is active (the default), or FALSE$ otherwise. Once it has been set to FALSE$ it cannot be turned back on until the Presentation Server is restarted.
Property Traits
Development | Runtime | Indexed | Scaled | Synthetic |
---|---|---|---|---|
N/A | Get/Set Once | No | No | No |
Remarks
“Window Ghosting” is a system function that Windows initiates when it thinks that a process has become unresponsive, typically because it gets involves in a long, time-consuming operation and doesn’t check its message queue periodically by calling the Yield function. When this happens, Windows adds a “Not Responding” message to the form’s caption, but unfortunately this can appear to end users to be some kind of error condition. It also allows the user to move or close the form as well, which could lead to other problems.
The ideal way to deal with this situation is to refactor long operations in the application so that they call Yield() periodically (every few seconds at least) so Windows is notified that the Presentation Server has not crashed or run into an infinite loop.
If this cannot be done the WINDOWGHOSTING property can be set to FALSE$ to stop this “Not Responding” behavior. However, in this case the user won't be able to minimize, move, or close the main window of the application if it really is not responding due to an error condition and they will have to use the Task Manager to close it instead, which may give the impression that the application is unstable.
This method is essentially a wrapper around the Windows API DisableProcessWindowsGhosting function – for further information please see the MSDN website.
Example
// Turn off Window Ghosting for the rest of the session Call Set_Property_Only ( "SYSTEM", "WINDOWGHOSTING", FALSE$ )
See Also
N/A