Jump to content

VioSetCp (OS/2 1.x): Difference between revisions

From EDM2
Ak120 (talk | contribs)
mNo edit summary
Ak120 (talk | contribs)
mNo edit summary
 
Line 1: Line 1:
{{Legacy
|RepFunc=[[VioSetCp]]
|Remarks=This page list the older version of the function for reference.
}}
This call allows a process to set the code page used to display text data on the screen for the specified handle.
This call allows a process to set the code page used to display text data on the screen for the specified handle.


Line 9: Line 5:


==Parameters==
==Parameters==
;Reserved (USHORT) - input : Reserved word of 0s.
;Reserved (USHORT) - input: Reserved word of 0s.
;CodePageID (USHORT) - input : The CodePageID must be either 0, -1, -2, or have been specified on the CONFIG.SYS CODEPAGE = statement. A value of 0000 indicates that the code page is to be set to the default ROM code page provided by the hardware. A value of -1 enables the user font codepage if user fonts have previously been set with VioSetFont. A value of -2 disables the user font and re-enables the prepared system codepage or ROM codepage that was active before the user font was enabled.
;CodePageID (USHORT) - input: The CodePageID must be either 0, -1, -2, or have been specified on the CONFIG.SYS CODEPAGE = statement. A value of 0000 indicates that the code page is to be set to the default ROM code page provided by the hardware. A value of -1 enables the user font codepage if user fonts have previously been set with [[VioSetFont]]. A value of -2 disables the user font and re-enables the prepared system codepage or ROM codepage that was active before the user font was enabled.
: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.
: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.
; VioHandle (HVIO) - input : This must be zero unless the caller is a Presentation Manager application, in which case it must be the value returned by VioGetPs.
;VioHandle (HVIO) - input : This must be zero unless the caller is a Presentation Manager application, in which case it must be the value returned by VioGetPs.


==Return Code==
==Return Code==
;rc (USHORT) - return:Return code descriptions are:
;rc (USHORT) - return:Return code descriptions are:
* 0   NO_ERROR
*0 NO_ERROR
* 355 ERROR_VIO_MODE
*355 ERROR_VIO_MODE
* 436 ERROR_VIO_INVALID_HANDLE
*436 ERROR_VIO_INVALID_HANDLE
* 465 ERROR_VIO_DETACHED
*465 ERROR_VIO_DETACHED
* 469 ERROR_VIO_BAD_CP
*469 ERROR_VIO_BAD_CP
* 470 ERROR_VIO_NO_CP
*470 ERROR_VIO_NO_CP
* 471 ERROR_VIO_NA_CP
*471 ERROR_VIO_NA_CP


==Remarks==
==Remarks==
Line 34: Line 30:
CODEPAGE = statement; -1 and -2 are not valid for PM.
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.
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.


==Example Code==
==Bindings==
=== C Binding===
=== C ===
<PRE>
<PRE>
#define INCL_VIO
#define INCL_VIO
Line 50: Line 46:
</PRE>
</PRE>


===MASM Binding===
===MASM===
<PRE>
<PRE>
EXTRN  VioSetCp:FAR
EXTRN  VioSetCp:FAR

Latest revision as of 15:52, 28 February 2020

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

Reserved (USHORT) - input
Reserved word of 0s.
CodePageID (USHORT) - input
The CodePageID must be either 0, -1, -2, or have been specified on the CONFIG.SYS CODEPAGE = statement. A value of 0000 indicates that the code page is to be set to the default ROM code page provided by the hardware. A value of -1 enables the user font codepage if user fonts have previously been set with VioSetFont. A value of -2 disables the user font and re-enables the prepared system codepage or ROM codepage that was active before the user font was enabled.
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.
VioHandle (HVIO) - input
This must be zero unless the caller is a Presentation Manager application, in which case it must be the value returned by VioGetPs.

Return Code

rc (USHORT) - return
Return code descriptions are:
  • 0 NO_ERROR
  • 355 ERROR_VIO_MODE
  • 436 ERROR_VIO_INVALID_HANDLE
  • 465 ERROR_VIO_DETACHED
  • 469 ERROR_VIO_BAD_CP
  • 470 ERROR_VIO_NO_CP
  • 471 ERROR_VIO_NA_CP

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