|
||||
SetSystemCursorCategory: CursorHits: 7649 Rating: (3.22) votes 711
Rate: 1-star 2-stars 3-stars 4-stars 5-stars
API Explanation
SetSystemCursor changes one of the cursors that Windows provides. For example, this function can change the cursor used to represent the default arrow cursor. Be careful using this function, since this redefines the default cursors instead of simply setting the current look of the cursor. The function destroys the cursor handle passed to it once it sets the new default cursor. The function returns 1 if successful, or 0 if an error occured. Parameter Information Declare Function SetSystemCursor Lib "user32.dll" (ByVal hcur As _ Long, ByVal id As Long) As Long hcur A handle to the cursor to use as the new default cursor for a given type of cursor. The function destroys this handle once the new cursor is set. id Exactly one of the following flags specifying which of the Windows default cursors to redefine: OCR_APPSTARTING = 32650 The application starting (arrow and hourglass) cursor. OCR_CROSS = 32515 The cross-shaped cursor. OCR_IBEAM = 32513 The text selection (I-beam) cursor. OCR_ICON = 32641 Win NT only: The empty icon cursor. OCR_NO = 32648 The "no"-symbol (circle with slash through it) cursor. OCR_NORMAL = 32512 The normal arrow cursor. OCR_SIZE = 32640 Win NT only: The four-arrow resize/move cursor. OCR_SIZEALL = 32646 The four-arrow resize/move cursor. OCR_SIZENESW = 32643 The double-arrow resize/move cursor pointing to the upper-right and lower-left. OCR_SIZENS = 32645 The double-arrow resize/move cursor pointing up and down. OCR_SIZENWSE = 32642 The double-arrow resize/move cursor pointing to the upper-left and lower-right. OCR_SIZEWE = 32644 The double-arrow resize/move cursor pointing left and right. OCR_UP = 32516 The up arrow cursor. OCR_WAIT = 32514 The waiting (hourglass) cursor.
Code
' Set Windows's default "hourglass" cursor to the cursor in
' C:\\MyProg\\NewWait.ani. Dim hcursor As Long ' receives handle to the cursor from the file Dim retval As Long ' return value ' Load the desired cursor from the file: hcursor = LoadCursorFromFile("C:\\MyProg\\NewWait.ani") retval = SetSystemCursor(hcursor, OCR_WAIT) ' redefine hourglass cursor ' Now Windows will use NewWait.ani as the hourglass cursor. |