Jump to content

VioGetCurType (FAPI): Difference between revisions

From EDM2
Created page with "==Description== This call returns the cursor type. ==Syntax== <PRE> VioGetCurType (CursorData, VioHandle) </PRE> ==Parameters== ; CursorData (PVIOCURSORINFO) - output..."
 
Ak120 (talk | contribs)
mNo edit summary
Line 1: Line 1:
==Description==
This call returns the cursor type.
This call returns the cursor type.


==Syntax==
==Syntax==
<PRE>
  VioGetCurType (CursorData, VioHandle)
  VioGetCurType
 
    (CursorData, VioHandle)
</PRE>


==Parameters==
==Parameters==
; CursorData (PVIOCURSORINFO) - output :  Address of the cursor characteristics structure:
;CursorData (PVIOCURSORINFO) - output :  Address of the cursor characteristics structure:


startline (USHORT) : Horizontal scan line in the character cell that marks the top line of the cursor. If the character cell has n scan lines, 0 is the top scan line of the character cell and (n-1) is the bottom scan line.  
startline (USHORT) : Horizontal scan line in the character cell that marks the top line of the cursor. If the character cell has n scan lines, 0 is the top scan line of the character cell and (n-1) is the bottom scan line.  
Line 24: Line 19:
==Return Code==
==Return Code==
  rc (USHORT) - return
  rc (USHORT) - return
Return code descriptions are:
Return code descriptions are:
* 0        NO_ERROR  
* 0        NO_ERROR  
*355        ERROR_VIO_MODE  
*355        ERROR_VIO_MODE  
Line 34: Line 27:
==Remarks==
==Remarks==
If CursorStartLine and CursorEndLine were originally specified as percentages on VioSetCurType (using negative values), the positive values into which they were translated are returned. Refer to VioSetCurType for more information on how percentages can be used to set CursorStartLine and CursorEndLine independent of the number of scan lines per character cell.
If CursorStartLine and CursorEndLine were originally specified as percentages on VioSetCurType (using negative values), the positive values into which they were translated are returned. Refer to VioSetCurType for more information on how percentages can be used to set CursorStartLine and CursorEndLine independent of the number of scan lines per character cell.


===Family API Considerations===
===Family API Considerations===
In DOS mode, VioGetCurType returns only two values for cursorattrib: 0 = visible cursor, and -1 = hidden cursor.


In DOS mode, VioGetCurType returns only two values for cursorattrib: 0 = visible cursor, and -1 = hidden cursor.
==Example Code==
==Example Code==
=== C Binding===
=== C Binding===
Line 82: Line 74:
*  
*  


[[Category:The OS/2 API Project]]
[[Category:Vio]]

Revision as of 17:54, 28 February 2017

This call returns the cursor type.

Syntax

VioGetCurType (CursorData, VioHandle)

Parameters

CursorData (PVIOCURSORINFO) - output
Address of the cursor characteristics structure:

startline (USHORT) : Horizontal scan line in the character cell that marks the top line of the cursor. If the character cell has n scan lines, 0 is the top scan line of the character cell and (n-1) is the bottom scan line.

endline (USHORT) : Horizontal scan line in the character cell that marks the bottom line of the cursor. Scan lines within a character cell are numbered as defined in startline.

cursorwidth (USHORT) : Width of the cursor. In text modes, cursorwidth is the number of columns. The maximum number supported by the OS/2 base video subsystem is 1. In graphics modes, cursorwidth is the number of pels.

cursorattrib (USHORT) : A value of -1 denotes a hidden cursor, all other values in text mode denote normal cursor and in graphics mode denote color attribute.

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

Remarks

If CursorStartLine and CursorEndLine were originally specified as percentages on VioSetCurType (using negative values), the positive values into which they were translated are returned. Refer to VioSetCurType for more information on how percentages can be used to set CursorStartLine and CursorEndLine independent of the number of scan lines per character cell.

Family API Considerations

In DOS mode, VioGetCurType returns only two values for cursorattrib: 0 = visible cursor, and -1 = hidden cursor.

Example Code

C Binding

typedef struct _VIOCURSORINFO {  /* vioci */
  USHORT   yStart;               /*cursor start line */
  USHORT   cEnd;                 /* cursor end line */
  USHORT   cx;                   /* cursor width */
  USHORT   attr;                 /* -1=hidden cursor, any other=normal
                                       cursor */
} VIOCURSORINFO;

#define INCL_VIO

USHORT  rc = VioGetCurType(CursorData, VioHandle);

PVIOCURSORINFO   CursorData;    /* Cursor characteristics */
HVIO             VioHandle;     /* Vio handle */

USHORT           rc;            /* return code */

MASM Binding

VIOCURSORINFO struc
  vioci_yStart dw  ? ;cursor start line
  vioci_cEnd   dw  ? ;cursor end line
  vioci_cx     dw  ? ;cursor width
  vioci_attr   dw  ? ;-1=hidden cursor, any other=normal cursor
VIOCURSORINFO ends

EXTRN  VioGetCurType:FAR
INCL_VIO            EQU 1

PUSH@  OTHER   CursorData    ;Cursor characteristics
PUSH   WORD    VioHandle     ;Vio handle
CALL   VioGetCurType

Returns WORD

Related Functions