Difference between revisions of "MouSetPtrPos"

From EDM2
Jump to: navigation, search
(Created page with "==Description== Directs the mouse driver to set a new row and column coordinate position for the mouse pointer. ==Syntax== <PRE> #define INCL_MOU #include <os2.h> PPTRLOC ...")
 
m
 
(2 intermediate revisions by one user not shown)
Line 1: Line 1:
==Description==
 
 
Directs the mouse driver to set a new row and column coordinate position for the mouse pointer.
 
Directs the mouse driver to set a new row and column coordinate position for the mouse pointer.
  
 
==Syntax==
 
==Syntax==
 +
MouSetPtrPos(PtrPos, DeviceHandle);
 +
 +
==Parameters==
 +
;PtrPos (PPTRLOC) - input : Pointer position.
 +
:Address of the mouse pointer position structure.
 +
; DeviceHandle (HMOU) - input : Reserved. Must be 0.
 +
 +
==Return Code==
 +
rc (APIRET) - returns
 +
MouSetPtrPos returns one of the following values:
 +
* 0    NO_ERROR
 +
* 387  ERROR_MOUSE_INV_PARMS
 +
* 466  ERROR_MOU_DETACHED
 +
* 501  ERROR_MOUSE_NO_CONSOLE
 +
 +
==Sample==
 
<PRE>
 
<PRE>
 
#define INCL_MOU
 
#define INCL_MOU
Line 12: Line 27:
  
 
rc = MouSetPtrPos(PtrPos, DeviceHandle);
 
rc = MouSetPtrPos(PtrPos, DeviceHandle);
 
 
</PRE>
 
</PRE>
==Parameters==
 
;  PtrPos (PPTRLOC) - input : Pointer position.
 
Address of the mouse pointer position structure.
 
 
; DeviceHandle (HMOU) - input : Reserved. Must be 0.
 
 
==Return Code==
 
rc (APIRET) - returns
 
 
MouSetPtrPos returns one of the following values:
 
 
* 0    NO_ERROR
 
* 387        ERROR_MOUSE_INV_PARMS
 
* 466        ERROR_MOU_DETACHED
 
* 501        ERROR_MOUSE_NO_CONSOLE
 
  
 
==Remarks==
 
==Remarks==
 
The application must ensure that the specified coordinate position conforms to the current display mode orientation for the session. Pel values must be used for graphics modes, and character values must be used for text modes.
 
The application must ensure that the specified coordinate position conforms to the current display mode orientation for the session. Pel values must be used for graphics modes, and character values must be used for text modes.
  
This function has no effect on the definition of the display's current collision area specified in MouDrawPtr. If the mouse pointer image is directed into a defined collision area, the pointer image is not drawn until either the pointer is moved outside the collision area, or the collision area is released by MouDrawPtr.
+
This function has no effect on the definition of the display's current collision area specified in [[MouDrawPtr]]. If the mouse pointer image is directed into a defined collision area, the pointer image is not drawn until either the pointer is moved outside the collision area, or the collision area is released by MouDrawPtr.
  
 
At session initialization, the pointer is set to the center of the screen but is not drawn, because the collision area is set to the entire screen.  
 
At session initialization, the pointer is set to the center of the screen but is not drawn, because the collision area is set to the entire screen.  
  
==Example Code==
+
[[Category:Mou]]
<PRE>
+
 
+
</PRE>
+
==Related Functions==
+
*
+
 
+
 
+
[[Category:The OS/2 API Project]]
+

Latest revision as of 13:22, 29 February 2020

Directs the mouse driver to set a new row and column coordinate position for the mouse pointer.

Syntax

MouSetPtrPos(PtrPos, DeviceHandle);

Parameters

PtrPos (PPTRLOC) - input 
Pointer position.
Address of the mouse pointer position structure.
DeviceHandle (HMOU) - input 
Reserved. Must be 0.

Return Code

rc (APIRET) - returns

MouSetPtrPos returns one of the following values:

  • 0 NO_ERROR
  • 387 ERROR_MOUSE_INV_PARMS
  • 466 ERROR_MOU_DETACHED
  • 501 ERROR_MOUSE_NO_CONSOLE

Sample

#define INCL_MOU
#include <os2.h>

PPTRLOC    PtrPos;        /*  Pointer position. */
HMOU       DeviceHandle;  /*  Reserved.  Must be 0. */
APIRET     rc;            /*  Return code. */

rc = MouSetPtrPos(PtrPos, DeviceHandle);

Remarks

The application must ensure that the specified coordinate position conforms to the current display mode orientation for the session. Pel values must be used for graphics modes, and character values must be used for text modes.

This function has no effect on the definition of the display's current collision area specified in MouDrawPtr. If the mouse pointer image is directed into a defined collision area, the pointer image is not drawn until either the pointer is moved outside the collision area, or the collision area is released by MouDrawPtr.

At session initialization, the pointer is set to the center of the screen but is not drawn, because the collision area is set to the entire screen.