win12.hlp (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
WinCreateCursor (1.2)
Function Group  Overview                          Up Next Previous
────────────────────────────────────────────────────────────────────────────
 
#define INCL_WINCURSORS
 
BOOL WinCreateCursor(hwnd, x, y, cx, cy, fs, prclClip)
HWND hwnd;          /* handle of the window with the cursor  */
SHORT x;            /* horizontal position of the cursor     */
SHORT y;            /* vertical position of the cursor       */
SHORT cx;           /* cursor width                          */
SHORT cy;           /* cursor height                         */
USHORT fs;          /* cursor appearance                     */
PRECTL prclClip;    /* address of structure with cursor area */
 
The WinCreateCursor function creates a cursor for a specified window.
 
Parameter  Description
────────────────────────────────────────────────────────────────────────────
 
hwnd       Identifies the window in which the cursor is displayed. This
           parameter can be the desktop window handle or HWND_DESKTOP.
 
x          Specifies the horizontal position of the cursor.
 
y          Specifies the vertical position of the cursor.
 
cx         Specifies the width of the cursor. If this parameter is zero, the
           system border width (SV_CXBORDER) is used.
 
cy         Specifies the height size of cursor. If this parameter is zero,
           the system border height (SV_CYBORDER) is used.
 
fs         Specifies the appearance of the cursor. This parameter can be one
           of the following values:
 
           Value            Meaning
           ─────────────────────────────────────────────────────────────────
           CURSOR_FLASH     Cursor flashes.
 
           CURSOR_FRAME     Cursor is a rectangular frame.
 
           CURSOR_HALFTONE  Cursor is halftone.
 
           CURSOR_SOLID     Cursor is solid.
 
           CURSOR_SETPOS    Set a new cursor position. The cx and cy
                            parameters are ignored. Used when a cursor has
                            already been created. All other appearance flags
                            are ignored.
 
prclClip   Points to the RECTL structure that contains the coordinates of a
           rectangle within which the cursor is visible. If the cursor goes
           outside this rectangle, it becomes invisible (it is clipped). The
           rectangle is specified in window coordinates. If prclClip is
           NULL, the cursor is clipped to the window identified by the hwnd
           parameter.
 
Return Value
 
The return value is TRUE if the function is successful or FALSE if an error
occurs.
 
Comments
 
The cursor is used to indicate the position of text input. It is initially
hidden and must be made visible by using the WinShowCursor function.
 
Only one cursor is available at a time on a given screen. If another cursor
exists when this function is called, it is destroyed. An application should
create and display a cursor when it has the input focus or is the active
window. Creating a cursor at any other time may stop the cursor from
flashing in another window. Similarly, when the application loses the input
focus or becomes inactive, it should destroy its cursor.
 
The cursor width is typically specified as zero (default width is used).
This is preferable to a value of 1 because such a fine width will be almost
invisible on a high-resolution device.
 
See Also
 
WinDestroyCursor, WinQueryCursorInfo, WinShowCursor, RECTL