[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
  SetCursor( hCursor )-> <hOldCursor>
------------------------------------------------------------------------------


 PARAMETER:

  <hCursor>    Is the handle that identifies the new mouse cursor


 RETURNS:

  <hOldCursor> is the handle of the previous cursor



 DESCRIPTION:

  The SetCursor function changes the given cursor. It is set only if the new
  cursor is different from the previous cursor; otherwise, SetCursor() 
  returns immediately.
  The cursor is a shared resource. A window should set the cursor only when
  it is in the window's client area or when the window is capturing all
  mouse input. In systems without a mouse, the window should restore the
  previous cursor before the cursor leaves the client area or before the
  window relinquishes control to another window. 

  Any application that must set the cursor while it is in a window must
  ensure that the instance var oCursor contains an object of the new cursor,
  or the system will restore the previous shape each time the mouse is moved
  For additional examples, please see SAMPLES\TestCurs.prg


 EXAMPLE:


    +--------------------------------------------------------------+
    |  /* Select an hourglas cursor  */                            |
    |  oWnd:oCursor := TCURSOR():NEW()                             |
    |  oWnd:oCursor:hCursor := LoadCursor( 0, IDC_WAIT )           |
    |                                                              |
    |  SetCursor( oWnd:oCursor:hCursor )                           |
    |                                                              |
    |  /* Reset to arrow cursor */                                 |
    |  IF !( oWnd:oCursor == NIL )                                 |
    |     oWnd:oCursor := nil                                      |
    |     CursorArrow()                                            |
    |  ENDIF                                                       |
    +--------------------------------------------------------------+


 SOURCE:

  SOURCE\WINAPI\CURSORS.C



See Also: CursorArrow LoadCursor TCURSOR DEFINE CURSOR
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson