subcalls.hlp (
Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
VioSavRedrawWait (1.2)
◄Overview► ◄Up► ◄Next► ◄Previous►
────────────────────────────────────────────────────────────────────────────
#define INCL_VIO
USHORT VioSavRedrawWait(fEvent, pfNotify, usReserved)
USHORT fEvent; /* event flag */
PUSHORT pfNotify; /* pointer to variable for notify flag */
USHORT usReserved; /* must be zero */
The VioSavRedrawWait function waits for a screen switch to occur. When a
switch occurs, MS OS/2 sets the variable pointed to by the pfNotify
parameter to a value that indicates the type of changes. The thread may then
save or restore the display depending on the value pointed to by the
pfNotify parameter. The thread must also save or restore the complete video
mode, the state information, the registers, and the contents of the physical
video buffer.
MS OS/2 permits only one process in a screen group to wait for a screen
switch. The first process to make a request owns it.
The VioSavRedrawWait function is used typically by graphics programs (or
text-mode programs that change the video registers directly) to save and
restore the screen before and after MS OS/2 switches from one screen group
to another. Screen switching often changes the screen mode and video
register values. A thread that calls the VioSavRedrawWait function waits
until a screen switch occurs and is then given control so that it can save
or restore the screen.
Parameter Description
────────────────────────────────────────────────────────────────────────────
fEvent Specifies the event flag of the event to wait for. If this flag
is VSRWI_SAVEANDREDRAW, the function returns when the screen
needs to be either saved or restored. If the flag is
VSRWI_REDRAW, the function returns only when the screen needs to
be restored.
pfNotify Points to the variable that receives the flag specifying the
action to carry out in response to the given event. If this flag
is VSWRN_SAVE, the thread saves the video buffer, the registers,
and the state information. If the flag is VSWRN_REDRAW, the
thread restores the video buffer, the registers, and the state
information.
usReserved Specifies a reserved value. This parameter must be zero.
Return Value
The return value is zero if the function is successful. Otherwise, it is an
error value, which may be one of the following:
ERROR_VIO_FUNCTION_OWNED
ERROR_VIO_INVALID_PARMS
ERROR_VIO_RETURN
Comments
When an application is notified that it should save its screen image, it
saves its physical video buffer, video mode, and any other information the
application needs in order to redraw its screen.
The thread that calls VioSavRedrawWait should carry out all tasks directly
related to saving and restoring the screen information. Whenever a screen
switch occurs, the thread should save or restore the screen and call
VioSavRedrawWait as quickly as possible. The thread can access the physical
video buffer, if necessary, but since the thread may not be the foreground
process, it must not use the VioScrLock function to lock the screen. The
thread should not call MS OS/2 functions (neither directly nor indirectly
through other functions) that may generate pop-up screens or error pop-up
screens. Doing so may cause MS OS/2 to lock up (that is, each call of the
thread generates a pop-up screen, which in turn calls the thread and
generates another pop-up screen, and so on). You can use the
VioSavRedrawUndo function to end the thread when it is no longer needed.
In some cases, a thread may receive a request to restore the screen before
receiving a request to save the screen. For such requests, the thread must
determine whether the given request is valid.
Programs that need to save and restore the screen after a pop-up screen
should use the VioModeWait function.
See Also
VioGetPhysBuf, VioModeWait, VioSavRedrawUndo, VioScrLock
♦