CHANGE THE SYSTEM-CURSOR USING THE API -------------------------------------------------------- Submitted by Olivier Citeau and compiled by PowerObject! /////////////////////////////////////////////////////////////////////////////////// // Global CONSTANTs // LoadCursor/SetSystemCursor() functions /////////////////////////////////////////////////////////////////////////////////// CONSTANT integer IDC_APPSTARTING = 32650 ; CONSTANT integer IDC_ARROW = 32512 ; CONSTANT integer OCR_NORMAL = 32512 ; /////////////////////////////////////////////////////////////////////////////////// // Global External Functions /////////////////////////////////////////////////////////////////////////////////// FUNCTION long LoadCursorA( long hInstance, long lpCursorName ) Library "user32.dll" FUNCTION boolean SetSystemCursor( long hcur, long id ) Library "user32.dll" /////////////////////////////////////////////////////////////////////////////////// // Set Cursor - AppStarting /////////////////////////////////////////////////////////////////////////////////// long ll_Cursor ; // ll_Cursor = LoadCursorA( 0, IDC_APPSTARTING ) ; SetSystemCursor( ll_Cursor, OCR_NORMAL ) ; /////////////////////////////////////////////////////////////////////////////////// // Set Cursor - Normal /////////////////////////////////////////////////////////////////////////////////// long ll_Cursor ; // ll_Cursor = LoadCursorA( 0, IDC_ARROW ) ; SetSystemCursor( ll_Cursor, OCR_NORMAL ) ; *********************************************************************************** VISUAL BASIC: http://support.microsoft.com/default.aspx?scid=KB;EN-US;q160041&FR=0 /////////////////////////////////////////////////////////////////////////////////// // Visual Basic script /////////////////////////////////////////////////////////////////////////////////// Private Const IDC_APPSTARTING = 32650& Private Const IDC_ARROW = 32512& Private Const OCR_NORMAL = 32512& Private Declare Function LoadCursor Lib "user32" Alias "LoadCursorA" (ByVal hInstance As Long, ByVal lpCursorName As Long) As Long Private Declare Function SetSystemCursor Lib "user32" (ByVal hcur As Long, ByVal id As Long) As Boolean /////////////////////////////////////////////////////////////////////////////////// // Set Cursor - Normal /////////////////////////////////////////////////////////////////////////////////// Add two CommandButtons, Command1 and Command2, to Form1. Add the following code to the Click event of Command1: Private Sub Command1_Click() Dim hcursor As Long, ret_val As Long hcursor = LoadCursor(0, IDC_APPSTARTING) ret_val = SetSystemCursor(hcursor, OCR_NORMAL) End Sub /////////////////////////////////////////////////////////////////////////////////// // Set Cursor - Normal /////////////////////////////////////////////////////////////////////////////////// Add the following code to the Click event of Command2: Private Sub Command2_Click() Dim hcursor As Long, ret_val As Long hcursor = LoadCursor(0, IDC_ARROW) ret_val = SetSystemCursor(hcursor, OCR_NORMAL) End Sub