GreGetCodePage
Appearance
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);