Method XbpCrt():setPointer() Foundation

Defines the shape of the mouse pointer.

Syntax
:setPointer( [<cDllName>],  <nResID>, ;
             [<nType>   ], [<lFrame>] ) --> lSuccess
Parameters
<cDllName>
<cDllName> is an optional character string containing the name of a DLL file the resource for the mouse pointer is linked to. If <cDllName> is not specified, the resource file for the mouse pointer must be linked to the EXE file.
<nResID>
<nResID> is the numeric resource ID for the mouse pointer. Normally, the mouse pointer is defined in a PTR file.
However, a number of system-defined mouse pointers are available that can be selected if the parameter <nType> is set to the constant XBPWINDOW_POINTERTYPE_SYSPOINTER. In this case, the following #define constants from XBP.CH are available:
Constants for pre-defined mouse pointers
Constant Description
XBPSTATIC_SYSICON_DEFAULT Default mouse pointer
XBPSTATIC_SYSICON_ARROW Normal arrow
XBPSTATIC_SYSICON_WAIT Hour glass or clock
XBPSTATIC_SYSICON_MOVE Move the window
XBPSTATIC_SYSICON_SIZE Change size (all directions)
XBPSTATIC_SYSICON_SIZENWSE Change size (North west-South east)
XBPSTATIC_SYSICON_SIZENESW Change size (North east-South west)
XBPSTATIC_SYSICON_SIZEWE Change size (West-East)
XBPSTATIC_SYSICON_SIZENS Change size (North-South)
<nType>
Constants defined in the file XBP.CH are used for <nType>. The table below lists all possible constants:
Constants for <nType>
Constant Description
XBPWINDOW_POINTERTYPE_POINTER *) Mouse pointer is defined in a PTR file (OS/2) or CUR file (Windows)
XBPWINDOW_POINTERTYPE_SYSPOINTER System defined mouse pointer
XBPWINDOW_POINTERTYPE_ICON Mouse pointer is defined in an ICO file
XBPWINDOW_POINTERTYPE_ANIMPOINTER Animated pointer is defined in an ANI file
XBPWINDOW_POINTERTYPE_OSHANDLE Pointer is specified as an operating system handle obtained using a Win32 API call. The handle must be freed by the application after the Crt object is destroyed.
  1. Default
<lFrame>
This parameter controls whether the mouse pointer changes its shape already when it is moved across the frame and title bar of a XbpCrt window (lFrame := .T.), or if it changes only within the drawing area of the window (lFrame := .F.). The default value is .F. (false).
Return

This method returns .T. (true) if the mouse pointer's shape is defined. Otherwise, .F. (false) is returned.

Description

The method :setPointer() defines the shape of the mouse pointer when it is moved across an XbpCrt window. The resource for the mouse pointer is identified by a numeric value and the corresponding resource file must be linked to an executable file (EXE or DLL).

If an animated pointer is to be set with the :setPointer() method, the corresponding ANI file must be compiled into the application as a user-defined resource as shown in the following example.

// This example demonstrates how an animated pointer 
// defined in an ANI file named MYCURSOR.ANI can be used 
// in an Xbase++ application. The ANI file must be 
// compiled into the application's resource as a user- 
// defined resource as shown below. To build the example, 
// paste the code into a file named TEST.PRG, and execute 
// the following commands in your commandline (shell): 
//  XPP TEST.PRG [ENTER] 
//  ARC TEST.ARC [ENTER] 
//  ALINK /PM:PM TEST.OBJ TEST.RES [ENTER] 

// Resource definition for the Resource Compiler 
// (ARC.EXE). Copy to a file named TEST.ARC 
USERDEF ANI 
 100 = FILE "mycursor.ani" 

// Source code of the example. Copy to a file 
// named TEST.PRG. 
#include "xbp.ch" 
// Source code of the example 
PROCEDURE Main() 
LOCAL c 

 // Use :setPointer() to change the 
 // main window's pointer to the 
 // animated pointer defined in the 
 // resource. The pointer has to 
 // be loaded first before it can be 
 // passed to the :setPointer() 
 // method 
 c := LoadResource( 100,, "ANI", "neutral" ) 
 SetAppWindow():setPointer( , c, XBPWINDOW_POINTERTYPE_ANIMPOINTER ) 

 WAIT 

RETURN 

Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.