GreSetCodePage: Difference between revisions
Appearance
Created page with "GreSetCodePage sets the current code page for characters written with the base (default) font. This function must be supported by the presentation driver. GreSetCodePage is ..." |
mNo edit summary |
||
Line 1: | Line 1: | ||
GreSetCodePage sets the current code page for characters written with the base (default) font. | GreSetCodePage sets the current code page for characters written with the base (default) font. | ||
This function must be supported by the presentation driver. GreSetCodePage is called by GpiSetCP in response to an application requesting to change the currently selected code page for the device context. | This function must be supported by the presentation driver. GreSetCodePage is called by GpiSetCP in response to an application requesting to change the currently selected code page for the device context. | ||
;Simulation support: None. This function is mandatory for all drivers. | ;Simulation support: None. This function is mandatory for all drivers. | ||
==Syntax== | ==Syntax== | ||
GreSetCodePage(hdc, lCodePage, pInstance, lFunction) | GreSetCodePage(hdc, lCodePage, pInstance, lFunction) | ||
==Parameters== | ==Parameters== | ||
;hdc (HDC) - input | ;hdc (HDC) - input:Device context handle. | ||
:Device context handle. | ;lCodePage (ULONG) - input:New code page. | ||
;pInstance (PVOID) - input:Pointer to instance data. | |||
;lCodePage (ULONG) - input | ;lFunction (ULONG) - input:High-order WORD=flags; low-order WORD=NGreSetCodePage. | ||
:New code page. | |||
;pInstance (PVOID) - input | |||
:Pointer to instance data. | |||
;lFunction (ULONG) - input | |||
:High-order WORD=flags; low-order WORD=NGreSetCodePage. | |||
==Return Code== | ==Return Code== | ||
;rc (BOOL) - returns | ;rc (BOOL) - returns:Return codes. | ||
:Return codes. | :On completion, the handling routine must return a BOOLEAN value to indicate success or an error. | ||
:*TRUE Successful | |||
:On completion, the handling routine must return a BOOLEAN value to indicate success or an error. | :*FALSE Error | ||
:Possible Errors Detected: When an error is detected, the handling routine must call WinSetErrorInfo to post the condition. Error codes for conditions that the handling routine is expected to check include: | |||
:*TRUE Successful | :*PMERR_DEV_FUNC_NOT_INSTALLED | ||
:*FALSE Error | :*PMERR_EXCEEDS_MAX_SEG_LENGTH | ||
:*PMERR_INSUFFICIENT_MEMORY | |||
:Possible Errors Detected: When an error is detected, the handling routine must call WinSetErrorInfo to post the condition. Error codes for conditions that the handling routine is expected to check include: | :*PMERR_INV_CODEPAGE | ||
:*PMERR_INV_HDC | |||
:*PMERR_DEV_FUNC_NOT_INSTALLED | :*PMERR_INV_IN_AREA | ||
:*PMERR_EXCEEDS_MAX_SEG_LENGTH | :Refer to the "Error Explanations" section in the ''Presentation Manager Programming Reference'' for further explanation. | ||
:*PMERR_INSUFFICIENT_MEMORY | |||
:*PMERR_INV_CODEPAGE | |||
:*PMERR_INV_HDC | |||
:*PMERR_INV_IN_AREA | |||
:Refer to the "Error Explanations" section in the Presentation Manager Programming Reference for further explanation. | |||
==Remarks== | ==Remarks== | ||
The default is the font that the system uses when the cbnd_Set attribute is hex 0000. (See Character Attributes.) When the base font is not in use, lCodePage is saved until required. When a DC is initialized, the code page is set to the default code page obtained from WinQueryProcessCp. | The default is the font that the system uses when the cbnd_Set attribute is hex 0000. (See Character Attributes.) When the base font is not in use, lCodePage is saved until required. When a DC is initialized, the code page is set to the default code page obtained from WinQueryProcessCp. | ||
<PRE> | <PRE> | ||
#define INCL_GRE_DEVMISC3 | #define INCL_GRE_DEVMISC3 | ||
Line 54: | Line 41: | ||
BOOL rc; /* Return codes. */ | BOOL rc; /* Return codes. */ | ||
rc = GreSetCodePage(hdc, lCodePage, pInstance, | rc = GreSetCodePage(hdc, lCodePage, pInstance, lFunction); | ||
</PRE> | </PRE> | ||
[[Category:Gre]] | [[Category:Gre]] |
Latest revision as of 16:13, 29 February 2020
GreSetCodePage sets the current code page for characters written with the base (default) font.
This function must be supported by the presentation driver. GreSetCodePage is called by GpiSetCP in response to an application requesting to change the currently selected code page for the device context.
- Simulation support
- None. This function is mandatory for all drivers.
Syntax
GreSetCodePage(hdc, lCodePage, pInstance, lFunction)
Parameters
- hdc (HDC) - input
- Device context handle.
- lCodePage (ULONG) - input
- New code page.
- pInstance (PVOID) - input
- Pointer to instance data.
- lFunction (ULONG) - input
- High-order WORD=flags; low-order WORD=NGreSetCodePage.
Return Code
- rc (BOOL) - returns
- Return codes.
- On completion, the handling routine must return a BOOLEAN value to indicate success or an error.
- TRUE Successful
- FALSE Error
- Possible Errors Detected: When an error is detected, the handling routine must call WinSetErrorInfo to post the condition. Error codes for conditions that the handling routine is expected to check include:
- PMERR_DEV_FUNC_NOT_INSTALLED
- PMERR_EXCEEDS_MAX_SEG_LENGTH
- PMERR_INSUFFICIENT_MEMORY
- PMERR_INV_CODEPAGE
- PMERR_INV_HDC
- PMERR_INV_IN_AREA
- Refer to the "Error Explanations" section in the Presentation Manager Programming Reference for further explanation.
Remarks
The default is the font that the system uses when the cbnd_Set attribute is hex 0000. (See Character Attributes.) When the base font is not in use, lCodePage is saved until required. When a DC is initialized, the code page is set to the default code page obtained from WinQueryProcessCp.
#define INCL_GRE_DEVMISC3 #include <os2.h> HDC hdc; /* Device context handle. */ ULONG lCodePage; /* New code page. */ PVOID pInstance; /* Pointer to instance data. */ ULONG lFunction; /* High-order WORD=flags; low-order WORD=NGreSetCodePage. */ BOOL rc; /* Return codes. */ rc = GreSetCodePage(hdc, lCodePage, pInstance, lFunction);