subcalls.hlp (Topic list)
VioSetState (1.2)
Overview  Changes                                 Up Next Previous
────────────────────────────────────────────────────────────────────────────
 
#define INCL_VIO
 
USHORT VioSetState(pvoidState, hvio)
PVOID pvoidState;    /* pointer to buffer with new state */
HVIO hvio;           /* video handle                     */
 
The VioSetState function sets the palette-register values, the overscan
(border) color, the blink/background intensity, the screen color, the
underline position, or the display adapter.
 
The VioSetState function is a family API function.
 
Parameter   Description
────────────────────────────────────────────────────────────────────────────
 
pvoidState  Points to the structure that contains the request type and the
            values to set. The structure type, which depends on the request
            type specified in the type field of each structure, is one of
            the following: VIOPALSTATE, VIOOVERSCAN, VIOINTENSITY,
            VIOCOLORREG, VIOSETULINELOC, or VIOSETTARGET.
 
hvio        Identifies an advanced video-input-and-output (AVIO)
            presentation space. For AVIO programs, this handle must have
            been created by using the VioCreatePS function. For other
            programs, hvio must be NULL.
 
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_INVALID_HANDLE
     ERROR_VIO_INVALID_LENGTH
 
Example
 
This example retrieves the current settings of the palette registers,
switches palette registers #0 and #7, and calls VioSetState to enable the
new settings.
 
BYTE abState[38];
PVIOPALSTATE pviopal;
USHORT usTmp;
pviopal = (PVIOPALSTATE) abState;
pviopal->cb = sizeof(abState);
pviopal->type = 0;             /* retrieves palette registers */
pviopal->iFirst = 0;           /* first register to retrieve  */
VioGetState(pviopal, 0);       /* retrieves current settings  */
usTmp = pviopal->acolor[0];    /* swaps #0 and #7             */
pviopal->acolor[0] = pviopal->acolor[7];
pviopal->acolor[7] = usTmp;
VioSetState(pviopal, 0);       /* enables new settings        */
 
See Also
 
VioCreatePS, VioGetState, VioSetMode, VIOCOLORREG, VIOINTENSITY,
VIOOVERSCAN, VIOPALSTATE, VIOSETTARGET, VIOSETULINELOC