Jump to content

GreDeviceSetCursor: Difference between revisions

From EDM2
Created page with "GreDeviceSetCursor sets the cursor bit map that defines the cursor shape. ;Simulation support: This function is mandatory for display drivers. For other drivers, it is simul..."
 
Ak120 (talk | contribs)
mNo edit summary
 
Line 1: Line 1:
GreDeviceSetCursor sets the cursor bit map that defines the cursor shape.  
GreDeviceSetCursor sets the cursor bit map that defines the cursor shape.


;Simulation support: This function is mandatory for display drivers. For other drivers, it is simulated by a handling routine in the graphics engine.  
;Simulation support: This function is mandatory for display drivers. For other drivers, it is simulated by a handling routine in the graphics engine.


==Syntax==
==Syntax==
  GreDeviceSetCursor(hdc, pptlHotSpot, hbm, pInstance, lFunction);
  GreDeviceSetCursor(hdc, pptlHotSpot, hbm, pInstance, lFunction)


==Parameters==
==Parameters==
;hdc (HDC) - input  
;hdc (HDC) - input:The device context handle.
:The device context handle.  
;pptlHotSpot (PPOINTL) - input:A pointer to hot spot coordinates.
 
:x : X-position of the hotspot within the cursor bit map
;pptlHotSpot (PPOINTL) - input  
:y : Y-position of the hotspot within the cursor bit map.
:A pointer to hot spot coordinates.  
;hbm (ULONG) - input:Bit-map handle used for the cursor image.
 
;pInstance (PVOID) - input:A pointer to instance data.
:;x  
;lFunction (ULONG) - input:High-order WORD=flags; low-order WORD=NGreDeviceSetCursor.
::X-position of the hotspot within the cursor bit map  
:;y  
::Y-position of the hotspot within the cursor bit map.  
 
;hbm (ULONG) - input  
:Bit-map handle used for the cursor image.  
 
;pInstance (PVOID) - input  
:A pointer to instance data.  
 
;lFunction (ULONG) - input  
:High-order WORD=flags; low-order WORD=NGreDeviceSetCursor.  


==Return Code==
==Return Code==
;fSuccess (BOOL) - returns  
;fSuccess (BOOL) - returns:Return codes.
:Return codes.  
:On completion, the handling routine must return BOOLEAN (fSuccess).
 
:*TRUE Successful
:On completion, the handling routine must return BOOLEAN (fSuccess).  
:*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_INV_COORDINATE
 
:*PMERR_INV_CURSOR_BITMAP
: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_HDC
:*PMERR_DEV_FUNC_NOT_INSTALLED  
:*PMERR_INV_COORDINATE  
:*PMERR_INV_CURSOR_BITMAP  
:*PMERR_INV_HDC  
 


==Remarks==
==Remarks==
GreDeviceSetCursor is subject to all clipping.  
GreDeviceSetCursor is subject to all clipping.


The handling routine takes the previous cursor bit map and replaces it with the one indicated by hbm. If hbm is NULL, the cursor has no shape and its image is removed from the display screen.  
The handling routine takes the previous cursor bit map and replaces it with the one indicated by hbm. If hbm is NULL, the cursor has no shape and its image is removed from the display screen.


==Sample Code==
==Sample Code==

Latest revision as of 00:02, 24 March 2020

GreDeviceSetCursor sets the cursor bit map that defines the cursor shape.

Simulation support
This function is mandatory for display drivers. For other drivers, it is simulated by a handling routine in the graphics engine.

Syntax

GreDeviceSetCursor(hdc, pptlHotSpot, hbm, pInstance, lFunction)

Parameters

hdc (HDC) - input
The device context handle.
pptlHotSpot (PPOINTL) - input
A pointer to hot spot coordinates.
x : X-position of the hotspot within the cursor bit map
y : Y-position of the hotspot within the cursor bit map.
hbm (ULONG) - input
Bit-map handle used for the cursor image.
pInstance (PVOID) - input
A pointer to instance data.
lFunction (ULONG) - input
High-order WORD=flags; low-order WORD=NGreDeviceSetCursor.

Return Code

fSuccess (BOOL) - returns
Return codes.
On completion, the handling routine must return BOOLEAN (fSuccess).
  • 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_INV_COORDINATE
  • PMERR_INV_CURSOR_BITMAP
  • PMERR_INV_HDC

Remarks

GreDeviceSetCursor is subject to all clipping.

The handling routine takes the previous cursor bit map and replaces it with the one indicated by hbm. If hbm is NULL, the cursor has no shape and its image is removed from the display screen.

Sample Code

#define INCL_GRE_BITMAPS
#include <os2.h>

HDC        hdc;          /*  The device context handle. */
PPOINTL    pptlHotSpot;  /*  A pointer to hot spot coordinates. */
ULONG      hbm;          /*  Bit-map handle used for the cursor image. */
PVOID      pInstance;    /*  A pointer to instance data. */
ULONG      lFunction;    /*  High-order WORD=flags; low-order WORD=NGreDeviceSetCursor. */
BOOL       fSuccess;     /*  Return codes. */

fSuccess = GreDeviceSetCursor(hdc, pptlHotSpot, hbm, pInstance, lFunction);