en:docs:fapi:mougetptrpos

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
en:docs:fapi:mougetptrpos [2021/10/07 13:46] – created prokusheven:docs:fapi:mougetptrpos [2021/11/04 13:10] (current) prokushev
Line 1: Line 1:
 +{{page>en:templates:fapiint}}
 +
 +====== MouGetPtrPos ======
 +
 This call queries the mouse driver to determine the current row and column coordinate position of the mouse pointer. This call queries the mouse driver to determine the current row and column coordinate position of the mouse pointer.
  
-==Syntax==+===== Syntax ===== 
 +<code c>
  MouGetPtrPos(PtrPos, DeviceHandle);  MouGetPtrPos(PtrPos, DeviceHandle);
 +</code>
  
-==Parameters== +===== Parameters =====
-;PtrPos (P[[PTRLOC]]) - output: Address of the mouse pointer position structure. +
-;DeviceHandle (HMOU) - input: Contains the handle of the mouse device obtained from a previous MouOpen.+
  
-==Return Code== +  * PtrPos ([[PPTRLOC]]) - outputAddress of the mouse pointer position structure. 
-;rc (USHORT) - return:Return code descriptions are+  DeviceHandle ([[HMOU]]) - input: Contains the handle of the mouse device obtained from a previous MouOpen.
-*0 NO_ERROR +
-*385 ERROR_MOUSE_NO_DEVICE +
-*466 ERROR_MOU_DETACHED +
-*501 ERROR_MOUSE_NO_CONSOLE +
-*505 ERROR_MOU_EXTENDED_SG+
  
-==Sample== +===== Return Code =====
-<PRE> +
-#define INCL_MOU +
-#include <os2.h>+
  
-PPTRLOC    PtrPos;        /* Pointer to the mouse pointer data structure. */ +rc (USHORT) - return:Return code descriptions are:
-HMOU       DeviceHandle;  /* Reserved.  Must be 0. */ +
-APIRET     rc;            /* Return code. */+
  
-rc = MouGetPtrPos(PtrPos, DeviceHandle); +  *0 NO_ERROR 
-</PRE>+  *385 ERROR_MOUSE_NO_DEVICE 
 +  *466 ERROR_MOU_DETACHED 
 +  *501 ERROR_MOUSE_NO_CONSOLE 
 +  *505 ERROR_MOU_EXTENDED_SG
  
 +===== Remarks =====
  
-==Remarks== 
 For a text window (VIO) application, the text window is a view on the larger logical video buffer (LVB). The mouse pointer can be outside that view and still be within the extent of the LVB. MouGetPtrPos then returns the coordinates of the cell under the mouse pointer. If the pointer is outside the LVB image extent, the coordinates of the nearest LVB cell are returned. In either case, the LVB is scrolled until the reported LVB cell appears within the view window. For a text window (VIO) application, the text window is a view on the larger logical video buffer (LVB). The mouse pointer can be outside that view and still be within the extent of the LVB. MouGetPtrPos then returns the coordinates of the cell under the mouse pointer. If the pointer is outside the LVB image extent, the coordinates of the nearest LVB cell are returned. In either case, the LVB is scrolled until the reported LVB cell appears within the view window.
  
-==Bindings== +===== Bindings ===== 
-===C=== + 
-<PRE>+====C==== 
 +<code c>
 typedef struct _PTRLOC { /* moupl */ typedef struct _PTRLOC { /* moupl */
   USHORT row;            /* pointer row coordinate screen position */   USHORT row;            /* pointer row coordinate screen position */
Line 48: Line 46:
  
 USHORT           rc;            /* return code */ USHORT           rc;            /* return code */
-</PRE>+</code>
  
-===MASM=== +====MASM==== 
-<PRE>+<code asm>
 PTRLOC  struc PTRLOC  struc
   moupl_row  dw  ? ;pointer row coordinate screen position   moupl_row  dw  ? ;pointer row coordinate screen position
Line 65: Line 63:
  
 Returns WORD Returns WORD
-</PRE>+</code> 
 + 
 + 
 +===== Example ===== 
 + 
 +<code asm> 
 +#define INCL_MOU 
 +#include <os2.h> 
 + 
 +PPTRLOC    PtrPos;        /* Pointer to the mouse pointer data structure. */ 
 +HMOU       DeviceHandle;  /* Reserved.  Must be 0. */ 
 +APIRET     rc;            /* Return code. */ 
 + 
 +rc = MouGetPtrPos(PtrPos, DeviceHandle); 
 +</code>
  
-[[Category:Mou]]+{{page>en:templates:fapi}}