home *** CD-ROM | disk | FTP | other *** search
- VERSION 2.00
- Begin Form Form1
- BackColor = &H00C0C0C0&
- BorderStyle = 1 'Fixed Single
- Caption = "Cursor demo by Pierre Fillion"
- ClientHeight = 2400
- ClientLeft = 1395
- ClientTop = 1560
- ClientWidth = 4365
- FillStyle = 0 'Solid
- Height = 2805
- Left = 1335
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 10
- ScaleMode = 4 'Character
- ScaleWidth = 36.375
- Top = 1215
- Width = 4485
- Begin PictureBox Picture2
- AutoSize = -1 'True
- BackColor = &H00C0C0C0&
- FillStyle = 0 'Solid
- Height = 510
- Left = 135
- Picture = CURSOR.FRX:0000
- ScaleHeight = 32
- ScaleMode = 3 'Pixel
- ScaleWidth = 32
- TabIndex = 5
- Top = 720
- Width = 510
- End
- Begin PictureBox Picture1
- AutoSize = -1 'True
- BackColor = &H00C0C0C0&
- FillStyle = 0 'Solid
- Height = 510
- Left = 120
- Picture = CURSOR.FRX:0302
- ScaleHeight = 32
- ScaleMode = 3 'Pixel
- ScaleWidth = 32
- TabIndex = 4
- Top = 120
- Width = 510
- End
- Begin CommandButton Command4
- Caption = "Exit"
- Height = 510
- Left = 2700
- TabIndex = 3
- Top = 1755
- Width = 1500
- End
- Begin TextBox Text1
- Height = 2130
- Left = 675
- MultiLine = -1 'True
- TabIndex = 2
- Text = "Test your hotspot here by selecting text..."
- Top = 135
- Width = 1905
- End
- Begin CommandButton Command2
- Caption = "Restore Cursor"
- Enabled = 0 'False
- Height = 510
- Left = 2700
- TabIndex = 1
- Top = 675
- Width = 1500
- End
- Begin CommandButton Command1
- Caption = "Set Cursor"
- Height = 510
- Left = 2700
- TabIndex = 0
- Top = 135
- Width = 1500
- End
- Option Explicit
- 'Old cursor handle
- Dim fOldCurHnd As Integer
- Sub Command1_Click ()
- Dim CtrlHandle As Integer
- 'Retreive the handle of the control where the cursor will change
- CtrlHandle = Form1.Text1.hWnd
- 'Set the cursor and return the old cursor handle for restore cursor
- fOldCurHnd = SetCursor(CtrlHandle, Picture1, Picture2)
- 'Only modify button state for demo
- Form1.Command1.Enabled = False
- Form1.Command2.Enabled = True
- Form1.Command4.Enabled = False
- End Sub
- Sub Command2_Click ()
- Dim Handle As Integer
- Handle = Form1.Text1.hWnd
- Call RestoreCursor(Handle, fOldCurHnd)
- 'Only modify button state for demo
- Form1.Command1.Enabled = True
- Form1.Command2.Enabled = False
- Form1.Command4.Enabled = True
- End Sub
- Sub Command4_Click ()
- End
- End Sub
-