GreGetCodePage: Difference between revisions
Appearance
Created page with "GreGetCodePage returns the current code page. This is the default code page obtained by WinQueryProcessCp during the enabling of the DC (see EnableDeviceContext) or the code p..." |
mNo edit summary |
||
Line 1: | Line 1: | ||
GreGetCodePage returns the current code page. This is the default code page obtained by WinQueryProcessCp during the enabling of the DC (see EnableDeviceContext) or the code page set by GreSetCodePage. | GreGetCodePage returns the current code page. This is the default code page obtained by WinQueryProcessCp during the enabling of the DC (see EnableDeviceContext) or the code page set by GreSetCodePage. | ||
This function must be supported by the presentation driver. GreGetCodePage is called by GpiQueryCP in response to an application requesting the currently selected code page for the device context. | This function must be supported by the presentation driver. GreGetCodePage is called by GpiQueryCP in response to an application requesting 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== | ||
GreGetCodePage(hdc, pInstance, lFunction) | GreGetCodePage(hdc, pInstance, lFunction) | ||
==Parameters== | ==Parameters== | ||
;hdc (HDC) - input | ;hdc (HDC) - input:Device context handle. | ||
:Device context handle. | ;pInstance (PVOID) - input:Pointer to instance data. | ||
;lFunction (ULONG) - input:High-order WORD=flags; low-order WORD=NGreGetCodePage. | |||
;pInstance (PVOID) - input | |||
:Pointer to instance data. | |||
;lFunction (ULONG) - input | |||
:High-order WORD=flags; low-order WORD=NGreGetCodePage. | |||
==Return Code== | ==Return Code== | ||
;rc (LONG) - returns | ;rc (LONG) - returns:Return Code. | ||
:Return Code. | :On completion, the handling routine must return the current code page (lCodePage) or GPI_ERROR. | ||
:Possible Errors Detected: When an error is detected, the handling routine must call WinSetErrorInfo to post the condition. An error code for conditions that the handling routine is expected to check is: | |||
:On completion, the handling routine must return the current code page (lCodePage) or GPI_ERROR. | :*PMERR_DEV_FUNC_NOT_INSTALLED | ||
:Refer to the "Error Explanations" section in the ''Presentation Manager Programming Reference'' for further explanation. | |||
:Possible Errors Detected: When an error is detected, the handling routine must call WinSetErrorInfo to post the condition. An error code for conditions that the handling routine is expected to check is: | |||
:*PMERR_DEV_FUNC_NOT_INSTALLED | |||
:Refer to the "Error Explanations" section in the Presentation Manager Programming Reference for further explanation. | |||
==Remarks== | ==Remarks== | ||
This function applies to the default font, not the currently selected font, which can be determined with a call to GreQueryFontAttributes (see GreQueryFontAttributes). | This function applies to the default font, not the currently selected font, which can be determined with a call to GreQueryFontAttributes (see GreQueryFontAttributes). | ||
==Sample Code== | ==Sample Code== |
Latest revision as of 04:41, 24 March 2020
GreGetCodePage returns the current code page. This is the default code page obtained by WinQueryProcessCp during the enabling of the DC (see EnableDeviceContext) or the code page set by GreSetCodePage.
This function must be supported by the presentation driver. GreGetCodePage is called by GpiQueryCP in response to an application requesting the currently selected code page for the device context.
- Simulation support
- None. This function is mandatory for all drivers.
Syntax
GreGetCodePage(hdc, pInstance, lFunction)
Parameters
- hdc (HDC) - input
- Device context handle.
- pInstance (PVOID) - input
- Pointer to instance data.
- lFunction (ULONG) - input
- High-order WORD=flags; low-order WORD=NGreGetCodePage.
Return Code
- rc (LONG) - returns
- Return Code.
- On completion, the handling routine must return the current code page (lCodePage) or GPI_ERROR.
- Possible Errors Detected: When an error is detected, the handling routine must call WinSetErrorInfo to post the condition. An error code for conditions that the handling routine is expected to check is:
- PMERR_DEV_FUNC_NOT_INSTALLED
- Refer to the "Error Explanations" section in the Presentation Manager Programming Reference for further explanation.
Remarks
This function applies to the default font, not the currently selected font, which can be determined with a call to GreQueryFontAttributes (see GreQueryFontAttributes).
Sample Code
#define INCL_GRE_DEVMISC3 #include <os2.h> HDC hdc; /* Device context handle. */ PVOID pInstance; /* Pointer to instance data. */ ULONG lFunction; /* High-order WORD=flags; low-order WORD=NGreGetCodePage. */ LONG rc; /* Return Code. */ rc = GreGetCodePage(hdc, pInstance, lFunction);