Table of Contents

This is part of Family API which allow to create dual-os version of program runs under OS/2 and DOS

Note: This is legacy API call. It is recommended to use 32-bit equivalent

2021/09/17 04:47 · prokushev · 0 Comments
2021/08/20 03:18 · prokushev · 0 Comments

VioSetCp

This call allows a process to set the code page used to display text data on the screen for the specified handle.

Syntax

 VioSetCp (Reserved, CodePageID, VioHandle)

Parameters

If the code page ID is not 0, -1, -2, or does not match one of the ID's on the CODEPAGE = statement, an error results. Refer to IBM Operating System/2 Command Reference for a complete description of CODEPAGE.

Return Code

rc (USHORT) - return:Return code descriptions are:

Remarks

VioSetCp can be used to enable and disable the user font code page as well as the prepared system code pages. If a prepared system code page or the ROM code page is specified, any previously set code page is disabled and the specified code page is enabled.

Specifying the special code page of -1 enables the user font code page if user fonts have previously been set. Specifying the special code page of -2 disables the user font code page and re-enables the prepared system code page or ROM code page that was active before the user font code page was enabled.

PM Considerations

Valid CodePageID values are 0 or one that was specified on the CONFIG.SYS

CODEPAGE = statement; -1 and -2 are not valid for PM.

This call can be used to set an EBCDIC code page for Advanced VIO. For a full-screen or Vio-windowed application, this function causes the displayed characters to be reinterpreted immediately in the new code page. For a Presentation Manager application, the characters in the base font are reinterpreted in the new code page only when other events cause the characters to be repainted. This function has no effect on displayed characters that use a font other than the base font.

Bindings

C

#define INCL_VIO
 
USHORT  rc = VioSetCp(Reserved, CodePageID, VioHandle);
 
USHORT  Reserved;      /* Reserved (must be zero) */
USHORT  CodePageID;    /* CodePage Id */
HVIO    VioHandle;     /* Video handle */
 
USHORT  rc;            /* return code */

MASM

EXTRN   VioSetCp:FAR
INCL_VIO            EQU 1
 
PUSH   WORD    Reserved      ;Reserved (must be zero)
PUSH   WORD    CodePageID    ;CodePage Id
PUSH   WORD    VioHandle     ;Video handle
CALL   VioSetCp
 
Returns WORD