home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / curlibm / curlibm.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-05-08  |  22.0 KB  |  640 lines

  1. VERSION 2.00
  2. Begin Form Form1 
  3.    AutoRedraw      =   -1  'True
  4.    BackColor       =   &H00C0C0C0&
  5.    Caption         =   "CURLIBM by Pierre Fillion (c)1992"
  6.    ClientHeight    =   6090
  7.    ClientLeft      =   585
  8.    ClientTop       =   1770
  9.    ClientWidth     =   6765
  10.    Height          =   6495
  11.    Left            =   525
  12.    LinkMode        =   1  'Source
  13.    LinkTopic       =   "Form1"
  14.    ScaleHeight     =   6090
  15.    ScaleWidth      =   6765
  16.    Top             =   1425
  17.    Width           =   6885
  18.    Begin CommandButton Command1 
  19.       Caption         =   "E&xit"
  20.       Height          =   315
  21.       Left            =   1950
  22.       TabIndex        =   0
  23.       Top             =   5550
  24.       Width           =   3315
  25.    End
  26.    Begin Timer Timer1 
  27.       Left            =   150
  28.       Top             =   5550
  29.    End
  30.    Begin PictureBox Picture1 
  31.       Height          =   915
  32.       Index           =   28
  33.       Left            =   3450
  34.       ScaleHeight     =   885
  35.       ScaleWidth      =   885
  36.       TabIndex        =   27
  37.       Top             =   4500
  38.       Width           =   915
  39.    End
  40.    Begin PictureBox Picture1 
  41.       Height          =   915
  42.       Index           =   27
  43.       Left            =   2400
  44.       ScaleHeight     =   885
  45.       ScaleWidth      =   885
  46.       TabIndex        =   26
  47.       Top             =   4500
  48.       Width           =   915
  49.    End
  50.    Begin PictureBox Picture1 
  51.       Height          =   915
  52.       Index           =   26
  53.       Left            =   1350
  54.       ScaleHeight     =   885
  55.       ScaleWidth      =   885
  56.       TabIndex        =   25
  57.       Top             =   4500
  58.       Width           =   915
  59.    End
  60.    Begin PictureBox Picture1 
  61.       Height          =   915
  62.       Index           =   25
  63.       Left            =   300
  64.       ScaleHeight     =   885
  65.       ScaleWidth      =   885
  66.       TabIndex        =   28
  67.       Top             =   4500
  68.       Width           =   915
  69.    End
  70.    Begin PictureBox Picture1 
  71.       Height          =   915
  72.       Index           =   24
  73.       Left            =   5550
  74.       ScaleHeight     =   885
  75.       ScaleWidth      =   885
  76.       TabIndex        =   24
  77.       Top             =   3450
  78.       Width           =   915
  79.    End
  80.    Begin PictureBox Picture1 
  81.       Height          =   915
  82.       Index           =   23
  83.       Left            =   4500
  84.       ScaleHeight     =   885
  85.       ScaleWidth      =   885
  86.       TabIndex        =   23
  87.       Top             =   3450
  88.       Width           =   915
  89.    End
  90.    Begin PictureBox Picture1 
  91.       Height          =   915
  92.       Index           =   22
  93.       Left            =   3450
  94.       ScaleHeight     =   885
  95.       ScaleWidth      =   885
  96.       TabIndex        =   22
  97.       Top             =   3450
  98.       Width           =   915
  99.    End
  100.    Begin PictureBox Picture1 
  101.       Height          =   915
  102.       Index           =   21
  103.       Left            =   2400
  104.       ScaleHeight     =   885
  105.       ScaleWidth      =   885
  106.       TabIndex        =   21
  107.       Top             =   3450
  108.       Width           =   915
  109.    End
  110.    Begin PictureBox Picture1 
  111.       Height          =   915
  112.       Index           =   20
  113.       Left            =   1350
  114.       ScaleHeight     =   885
  115.       ScaleWidth      =   885
  116.       TabIndex        =   20
  117.       Top             =   3450
  118.       Width           =   915
  119.    End
  120.    Begin PictureBox Picture1 
  121.       Height          =   915
  122.       Index           =   19
  123.       Left            =   300
  124.       ScaleHeight     =   885
  125.       ScaleWidth      =   885
  126.       TabIndex        =   19
  127.       Top             =   3450
  128.       Width           =   915
  129.    End
  130.    Begin PictureBox Picture1 
  131.       Height          =   915
  132.       Index           =   18
  133.       Left            =   5550
  134.       ScaleHeight     =   885
  135.       ScaleWidth      =   885
  136.       TabIndex        =   18
  137.       Top             =   2400
  138.       Width           =   915
  139.    End
  140.    Begin PictureBox Picture1 
  141.       Height          =   915
  142.       Index           =   17
  143.       Left            =   4500
  144.       ScaleHeight     =   885
  145.       ScaleWidth      =   885
  146.       TabIndex        =   16
  147.       Top             =   2400
  148.       Width           =   915
  149.    End
  150.    Begin PictureBox Picture1 
  151.       Height          =   915
  152.       Index           =   16
  153.       Left            =   3450
  154.       ScaleHeight     =   885
  155.       ScaleWidth      =   885
  156.       TabIndex        =   15
  157.       Top             =   2400
  158.       Width           =   915
  159.    End
  160.    Begin PictureBox Picture1 
  161.       Height          =   915
  162.       Index           =   15
  163.       Left            =   2400
  164.       ScaleHeight     =   885
  165.       ScaleWidth      =   885
  166.       TabIndex        =   14
  167.       Top             =   2400
  168.       Width           =   915
  169.    End
  170.    Begin PictureBox Picture1 
  171.       Height          =   915
  172.       Index           =   14
  173.       Left            =   1350
  174.       ScaleHeight     =   885
  175.       ScaleWidth      =   885
  176.       TabIndex        =   13
  177.       Top             =   2400
  178.       Width           =   915
  179.    End
  180.    Begin PictureBox Picture1 
  181.       Height          =   915
  182.       Index           =   13
  183.       Left            =   300
  184.       ScaleHeight     =   885
  185.       ScaleWidth      =   885
  186.       TabIndex        =   12
  187.       Top             =   2400
  188.       Width           =   915
  189.    End
  190.    Begin PictureBox Picture1 
  191.       Height          =   915
  192.       Index           =   12
  193.       Left            =   5550
  194.       ScaleHeight     =   885
  195.       ScaleWidth      =   885
  196.       TabIndex        =   17
  197.       Top             =   1350
  198.       Width           =   915
  199.    End
  200.    Begin PictureBox Picture1 
  201.       Height          =   915
  202.       Index           =   11
  203.       Left            =   4500
  204.       ScaleHeight     =   885
  205.       ScaleWidth      =   885
  206.       TabIndex        =   11
  207.       Top             =   1350
  208.       Width           =   915
  209.    End
  210.    Begin PictureBox Picture1 
  211.       Height          =   915
  212.       Index           =   10
  213.       Left            =   3450
  214.       ScaleHeight     =   885
  215.       ScaleWidth      =   885
  216.       TabIndex        =   10
  217.       Top             =   1350
  218.       Width           =   915
  219.    End
  220.    Begin PictureBox Picture1 
  221.       Height          =   915
  222.       Index           =   9
  223.       Left            =   2400
  224.       ScaleHeight     =   885
  225.       ScaleWidth      =   885
  226.       TabIndex        =   9
  227.       Top             =   1350
  228.       Width           =   915
  229.    End
  230.    Begin PictureBox Picture1 
  231.       Height          =   915
  232.       Index           =   8
  233.       Left            =   1350
  234.       ScaleHeight     =   885
  235.       ScaleWidth      =   885
  236.       TabIndex        =   8
  237.       Top             =   1350
  238.       Width           =   915
  239.    End
  240.    Begin PictureBox Picture1 
  241.       Height          =   915
  242.       Index           =   7
  243.       Left            =   300
  244.       ScaleHeight     =   885
  245.       ScaleWidth      =   885
  246.       TabIndex        =   7
  247.       Top             =   1350
  248.       Width           =   915
  249.    End
  250.    Begin PictureBox Picture1 
  251.       Height          =   915
  252.       Index           =   6
  253.       Left            =   5550
  254.       ScaleHeight     =   885
  255.       ScaleWidth      =   885
  256.       TabIndex        =   6
  257.       Top             =   300
  258.       Width           =   915
  259.    End
  260.    Begin PictureBox Picture1 
  261.       Height          =   915
  262.       Index           =   5
  263.       Left            =   4500
  264.       ScaleHeight     =   885
  265.       ScaleWidth      =   885
  266.       TabIndex        =   5
  267.       Top             =   300
  268.       Width           =   915
  269.    End
  270.    Begin PictureBox Picture1 
  271.       Height          =   915
  272.       Index           =   4
  273.       Left            =   3450
  274.       ScaleHeight     =   885
  275.       ScaleWidth      =   885
  276.       TabIndex        =   4
  277.       Top             =   300
  278.       Width           =   915
  279.    End
  280.    Begin PictureBox Picture1 
  281.       Height          =   915
  282.       Index           =   3
  283.       Left            =   2400
  284.       ScaleHeight     =   885
  285.       ScaleWidth      =   885
  286.       TabIndex        =   3
  287.       Top             =   300
  288.       Width           =   915
  289.    End
  290.    Begin PictureBox Picture1 
  291.       Height          =   915
  292.       Index           =   2
  293.       Left            =   1350
  294.       ScaleHeight     =   885
  295.       ScaleWidth      =   885
  296.       TabIndex        =   2
  297.       Top             =   300
  298.       Width           =   915
  299.    End
  300.    Begin PictureBox Picture1 
  301.       Height          =   915
  302.       Index           =   1
  303.       Left            =   300
  304.       ScaleHeight     =   885
  305.       ScaleWidth      =   885
  306.       TabIndex        =   1
  307.       Top             =   300
  308.       Width           =   915
  309.    End
  310.    Begin Label Label1 
  311.       BorderStyle     =   1  'Fixed Single
  312.       Height          =   915
  313.       Left            =   4500
  314.       TabIndex        =   29
  315.       Top             =   4500
  316.       Width           =   1965
  317.    End
  318. DefInt A-Z
  319. 'API functions to manipulate cursor libraries
  320. Declare Function LoadLibrary Lib "kernel" (ByVal LibName$)
  321. Declare Function LoadCursor Lib "user" (ByVal hInstance, ByVal CursorName$)
  322. Declare Function SetClassWord Lib "user" (ByVal hWnd, ByVal nIndex, ByVal NewVal)
  323. Declare Function DestroyCursor Lib "user" (ByVal Handle)
  324. Declare Function GetFocus Lib "user" ()
  325. Declare Function APISetFocus Lib "user" Alias "SetFocus" (ByVal hWnd)
  326. Declare Sub GetCursorPos Lib "user" (p As PointType)
  327. Declare Function WindowFromPoint Lib "user" (ByVal y, ByVal x)
  328. Declare Function ShowCursor Lib "User" (ByVal State%) As Integer
  329. Declare Function SetCursorPos Lib "User" (ByVal x%, ByVal y%) As Integer
  330. Const GCW_HCURSOR = (-12)
  331. 'Control Variable for cursors animations
  332. Dim LastTMP  As Long
  333. 'Cursors Handles
  334. Dim SysCursHandle
  335. Dim CursHandle(0 To 114)
  336. 'Objects hWnd
  337. Dim PicturehWnd(1 To 28)
  338. Dim Command1hWnd
  339. 'Type for cursor positions
  340. Dim p As PointType
  341. Sub Command1_Click ()
  342. Unload Form1
  343. End Sub
  344. Sub Form_Load ()
  345. Form1.Show
  346. 'Load Libraries
  347. DLLInstance = LoadLibrary("c:\windows\curr.dll")
  348. DLLInstance2 = LoadLibrary("c:\windows\curr2.dll")
  349. 'First Library of cursors
  350. CursHandle(0) = LoadCursor(DLLInstance, "A0")
  351. CursHandle(1) = LoadCursor(DLLInstance, "A1")
  352. CursHandle(2) = LoadCursor(DLLInstance, "A2")
  353. CursHandle(3) = LoadCursor(DLLInstance, "A3")
  354. CursHandle(4) = LoadCursor(DLLInstance, "A4")
  355. CursHandle(5) = LoadCursor(DLLInstance, "A5")
  356. CursHandle(6) = LoadCursor(DLLInstance, "A6")
  357. CursHandle(7) = LoadCursor(DLLInstance, "A7")
  358. CursHandle(8) = LoadCursor(DLLInstance, "BOMB0")
  359. CursHandle(9) = LoadCursor(DLLInstance, "BOMB1")
  360. CursHandle(10) = LoadCursor(DLLInstance, "CLOCK0")
  361. CursHandle(11) = LoadCursor(DLLInstance, "CLOCK1")
  362. CursHandle(12) = LoadCursor(DLLInstance, "CLOCK2")
  363. CursHandle(13) = LoadCursor(DLLInstance, "CLOCK3")
  364. CursHandle(14) = LoadCursor(DLLInstance, "CLOCK4")
  365. CursHandle(15) = LoadCursor(DLLInstance, "CLOCK5")
  366. CursHandle(16) = LoadCursor(DLLInstance, "CLOCK6")
  367. CursHandle(17) = LoadCursor(DLLInstance, "CLOCK7")
  368. CursHandle(18) = LoadCursor(DLLInstance, "LAMP0")
  369. CursHandle(19) = LoadCursor(DLLInstance, "LAMP1")
  370. CursHandle(20) = LoadCursor(DLLInstance, "HG0")
  371. CursHandle(21) = LoadCursor(DLLInstance, "HG1")
  372. CursHandle(22) = LoadCursor(DLLInstance, "HG2")
  373. CursHandle(23) = LoadCursor(DLLInstance, "HG3")
  374. CursHandle(24) = LoadCursor(DLLInstance, "HG4")
  375. CursHandle(25) = LoadCursor(DLLInstance, "HG5")
  376. CursHandle(26) = LoadCursor(DLLInstance, "HG6")
  377. CursHandle(27) = LoadCursor(DLLInstance, "HG7")
  378. CursHandle(28) = LoadCursor(DLLInstance, "HG8")
  379. CursHandle(29) = LoadCursor(DLLInstance, "HG9")
  380. CursHandle(30) = LoadCursor(DLLInstance, "WATCH0")
  381. CursHandle(31) = LoadCursor(DLLInstance, "WATCH1")
  382. CursHandle(32) = LoadCursor(DLLInstance, "WATCH2")
  383. CursHandle(33) = LoadCursor(DLLInstance, "WATCH3")
  384. CursHandle(34) = LoadCursor(DLLInstance, "ZZZ")
  385. CursHandle(35) = LoadCursor(DLLInstance, "SWORD")
  386. CursHandle(36) = LoadCursor(DLLInstance, "PIRANHA")
  387. CursHandle(37) = LoadCursor(DLLInstance, "CUT0")
  388. CursHandle(38) = LoadCursor(DLLInstance, "CUT1")
  389. CursHandle(39) = LoadCursor(DLLInstance, "CUT2")
  390. CursHandle(40) = LoadCursor(DLLInstance, "CUP0")
  391. CursHandle(41) = LoadCursor(DLLInstance, "CUP1")
  392. CursHandle(42) = LoadCursor(DLLInstance, "CUP2")
  393. CursHandle(43) = LoadCursor(DLLInstance, "CUP3")
  394. CursHandle(44) = LoadCursor(DLLInstance, "CUP4")
  395. CursHandle(45) = LoadCursor(DLLInstance, "CUP5")
  396. CursHandle(46) = LoadCursor(DLLInstance, "CUP6")
  397. CursHandle(47) = LoadCursor(DLLInstance, "CUP7")
  398. CursHandle(48) = LoadCursor(DLLInstance, "CUP8")
  399. CursHandle(49) = LoadCursor(DLLInstance, "CUP9")
  400. CursHandle(50) = LoadCursor(DLLInstance, "TIC0")
  401. CursHandle(51) = LoadCursor(DLLInstance, "TIC1")
  402. CursHandle(52) = LoadCursor(DLLInstance, "TIC2")
  403. CursHandle(53) = LoadCursor(DLLInstance, "TIC3")
  404. CursHandle(54) = LoadCursor(DLLInstance, "SCREW0")
  405. CursHandle(55) = LoadCursor(DLLInstance, "SCREW1")
  406. CursHandle(56) = LoadCursor(DLLInstance, "SCREW2")
  407. CursHandle(57) = LoadCursor(DLLInstance, "SCREW3")
  408. CursHandle(58) = LoadCursor(DLLInstance, "SCREW4")
  409. CursHandle(59) = LoadCursor(DLLInstance, "SCREW5")
  410. CursHandle(60) = LoadCursor(DLLInstance, "SPIRAL0")
  411. CursHandle(61) = LoadCursor(DLLInstance, "SPIRAL1")
  412. CursHandle(62) = LoadCursor(DLLInstance, "SPIRAL2")
  413. CursHandle(63) = LoadCursor(DLLInstance, "SPIRAL3")
  414. CursHandle(64) = LoadCursor(DLLInstance, "SPIRAL4")
  415. CursHandle(65) = LoadCursor(DLLInstance, "SPIRAL5")
  416. CursHandle(66) = LoadCursor(DLLInstance, "SPIRAL6")
  417. CursHandle(67) = LoadCursor(DLLInstance, "SPIRAL7")
  418. CursHandle(68) = LoadCursor(DLLInstance, "SPIRAL8")
  419. CursHandle(69) = LoadCursor(DLLInstance, "SPIRAL9")
  420. CursHandle(70) = LoadCursor(DLLInstance, "TERMO0")
  421. CursHandle(71) = LoadCursor(DLLInstance, "TERMO1")
  422. CursHandle(72) = LoadCursor(DLLInstance, "TERMO2")
  423. CursHandle(73) = LoadCursor(DLLInstance, "TERMO3")
  424. CursHandle(74) = LoadCursor(DLLInstance, "TERMO4")
  425. CursHandle(75) = LoadCursor(DLLInstance, "TERMO5")
  426. CursHandle(76) = LoadCursor(DLLInstance, "TERMO6")
  427. CursHandle(77) = LoadCursor(DLLInstance, "TERMO7")
  428. CursHandle(78) = LoadCursor(DLLInstance, "TERMO8")
  429. CursHandle(79) = LoadCursor(DLLInstance, "RAD0")
  430. CursHandle(80) = LoadCursor(DLLInstance, "RAD1")
  431. CursHandle(81) = LoadCursor(DLLInstance, "RAD2")
  432. CursHandle(82) = LoadCursor(DLLInstance, "RAD3")
  433. CursHandle(83) = LoadCursor(DLLInstance, "RAD4")
  434. CursHandle(84) = LoadCursor(DLLInstance, "HANDUP")
  435. CursHandle(85) = LoadCursor(DLLInstance, "HANDOPEN")
  436. CursHandle(86) = LoadCursor(DLLInstance, "HANDUR")
  437. CursHandle(87) = LoadCursor(DLLInstance, "LOOK")
  438. CursHandle(88) = LoadCursor(DLLInstance, "PAINT")
  439. CursHandle(89) = LoadCursor(DLLInstance, "MA0")
  440. CursHandle(90) = LoadCursor(DLLInstance, "MA1")
  441. CursHandle(91) = LoadCursor(DLLInstance, "MA2")
  442. CursHandle(92) = LoadCursor(DLLInstance, "MA3")
  443. CursHandle(93) = LoadCursor(DLLInstance, "MA4")
  444. CursHandle(94) = LoadCursor(DLLInstance, "MA5")
  445. CursHandle(95) = LoadCursor(DLLInstance, "MA6")
  446. CursHandle(96) = LoadCursor(DLLInstance, "MA7")
  447. CursHandle(97) = LoadCursor(DLLInstance, "MA8")
  448. CursHandle(98) = LoadCursor(DLLInstance, "MA9")
  449. CursHandle(99) = LoadCursor(DLLInstance, "JHG0")
  450. CursHandle(100) = LoadCursor(DLLInstance, "JHG1")
  451. CursHandle(101) = LoadCursor(DLLInstance, "JHG2")
  452. CursHandle(102) = LoadCursor(DLLInstance, "JHG3")
  453. CursHandle(103) = LoadCursor(DLLInstance, "JHG4")
  454. CursHandle(104) = LoadCursor(DLLInstance, "JHG5")
  455. CursHandle(105) = LoadCursor(DLLInstance, "JHG6")
  456. CursHandle(106) = LoadCursor(DLLInstance, "JHG7")
  457. CursHandle(107) = LoadCursor(DLLInstance, "JHG8")
  458. CursHandle(108) = LoadCursor(DLLInstance, "JHG9")
  459. 'Second Library of cursors
  460. CursHandle(109) = LoadCursor(DLLInstance2, "WRITE")
  461. CursHandle(110) = LoadCursor(DLLInstance2, "ERASE")
  462. CursHandle(111) = LoadCursor(DLLInstance2, "OK")
  463. CursHandle(112) = LoadCursor(DLLInstance2, "CANCEL")
  464. CursHandle(113) = LoadCursor(DLLInstance2, "MOUSE")
  465. CursHandle(114) = LoadCursor(DLLInstance2, "NO")
  466. SysCursHandle = SetClassWord(Form1.hWnd, GCW_HCURSOR, CursHandle(34))
  467. 'Get the current control with the input focus.
  468. CurrHwnd = GetFocus()
  469. 'Get the Pictures box handles
  470. For A = 1 To 28
  471.     Form1.Picture1(A).SetFocus
  472.     PicturehWnd(A) = GetFocus()
  473. Next A
  474. 'Get the Window handle of Command1.
  475. Command1.SetFocus
  476. Command1hWnd = GetFocus()
  477. 'Restore the focus to the control with the input focus
  478. r = APISetFocus(CurrHwnd)
  479. 'One millisecond
  480. Timer1.Interval = 1
  481. Timer1.Enabled = -1
  482. End Sub
  483. Sub Form_Unload (Cancel As Integer)
  484. 'Restore the custom cursors to the system cursor:
  485. '(CursHandle(3) is the windows arrow)
  486. 'Remove the rem if you want to fix the observation reported in note 1 in CURLIBM.BAS
  487. 'LastCursor = SetClassWord(Form1.hWnd, GCW_HCURSOR, CursHandle(3))
  488. 'LastCursor = SetClassWord(Command1hWnd, GCW_HCURSOR, CursHandle(3))
  489. 'Delete the cursor resources from memory:
  490. For A = 1 To 114
  491. Success = DestroyCursor(CursHandle(A))
  492. Next A
  493. End Sub
  494. Sub Timer1_Timer ()
  495. 'Get the current (absolute) cursor position
  496. Call GetCursorPos(p)
  497. 'Find out which control the midpoint of the cursor is over (The cursor
  498. 'is 32 x 32 pixels square) and change the class word of the control
  499. 'to the appropriate cursor.
  500. Select Case WindowFromPoint(p.y, p.x)
  501. Case Form1.hWnd:
  502.      LastCursor = SetClassWord(Form1.hWnd, GCW_HCURSOR, CursHandle(34))
  503. Case Command1hWnd:
  504.      LastCursor = SetClassWord(Command1hWnd, GCW_HCURSOR, CursHandle(3))
  505. Case PicturehWnd(1):
  506.      If LastTMP > 7 Then LastTMP = 0
  507.      LastCursor = SetClassWord(PicturehWnd(1), GCW_HCURSOR, CursHandle(LastTMP))
  508.      LastTMP = LastTMP + 1
  509. Case PicturehWnd(2):
  510.      If LastTMP <> 1 Then
  511.     LastCursor = SetClassWord(PicturehWnd(2), GCW_HCURSOR, CursHandle(8))
  512.     LastTMP = 1
  513.      Else
  514.     LastCursor = SetClassWord(PicturehWnd(2), GCW_HCURSOR, CursHandle(9))
  515.     LastTMP = 2
  516.      End If
  517. Case PicturehWnd(3):
  518.      If LastTMP / 3 = Int(LastTMP / 3) Then
  519.     If LastTMP > 21 Then LastTMP = 0
  520.     LastCursor = SetClassWord(PicturehWnd(3), GCW_HCURSOR, CursHandle(LastTMP / 3 + 10))
  521.     LastTMP = LastTMP + 1
  522.      Else
  523.     LastTMP = LastTMP + 1
  524.      End If
  525. Case PicturehWnd(4):
  526.      If LastTMP <> 1 Then
  527.     LastCursor = SetClassWord(PicturehWnd(4), GCW_HCURSOR, CursHandle(18))
  528.     LastTMP = 1
  529.      Else
  530.     LastCursor = SetClassWord(PicturehWnd(4), GCW_HCURSOR, CursHandle(19))
  531.     LastTMP = 2
  532.      End If
  533. Case PicturehWnd(5):
  534.      If LastTMP > 9 Then LastTMP = 0
  535.      LastCursor = SetClassWord(PicturehWnd(5), GCW_HCURSOR, CursHandle(LastTMP + 20))
  536.      LastTMP = LastTMP + 1
  537. Case PicturehWnd(6):
  538.      If LastTMP / 12 = Int(LastTMP / 12) Then
  539.     If LastTMP > 36 Then LastTMP = 0
  540.     LastCursor = SetClassWord(PicturehWnd(6), GCW_HCURSOR, CursHandle((LastTMP / 12) + 30))
  541.     LastTMP = LastTMP + 1
  542.      Else
  543.       LastTMP = LastTMP + 1
  544.      End If
  545. Case PicturehWnd(7):
  546.      LastCursor = SetClassWord(PicturehWnd(7), GCW_HCURSOR, CursHandle(34))
  547. Case PicturehWnd(8):
  548.      LastCursor = SetClassWord(PicturehWnd(8), GCW_HCURSOR, CursHandle(35))
  549. Case PicturehWnd(9):
  550.      LastCursor = SetClassWord(PicturehWnd(9), GCW_HCURSOR, CursHandle(36))
  551. Case PicturehWnd(10):
  552.      If LastTMP < 3 Then
  553.     LastCursor = SetClassWord(PicturehWnd(10), GCW_HCURSOR, CursHandle(37 + LastTMP))
  554.     LastTMP = LastTMP + 1
  555.      Else
  556.     LastTMP = 0
  557.      End If
  558. Case PicturehWnd(11):
  559.      If LastTMP < 10 Then
  560.     LastCursor = SetClassWord(PicturehWnd(11), GCW_HCURSOR, CursHandle(40 + LastTMP))
  561.     LastTMP = LastTMP + 1
  562.      Else
  563.     LastTMP = 0
  564.      End If
  565. Case PicturehWnd(12):
  566.      If LastTMP < 4 Then
  567.     LastCursor = SetClassWord(PicturehWnd(12), GCW_HCURSOR, CursHandle(50 + LastTMP))
  568.     LastTMP = LastTMP + 1
  569.      Else
  570.     LastTMP = 0
  571.      End If
  572. Case PicturehWnd(13):
  573.      If LastTMP < 6 Then
  574.     LastCursor = SetClassWord(PicturehWnd(13), GCW_HCURSOR, CursHandle(54 + LastTMP))
  575.     LastTMP = LastTMP + 1
  576.      Else
  577.     LastTMP = 0
  578.  End If
  579. Case PicturehWnd(14):
  580.      If LastTMP < 10 Then
  581.     LastCursor = SetClassWord(PicturehWnd(14), GCW_HCURSOR, CursHandle(60 + LastTMP))
  582.     LastTMP = LastTMP + 1
  583.      Else
  584.     LastTMP = 0
  585.      End If
  586. Case PicturehWnd(15):
  587.      If LastTMP < 9 Then
  588.     LastCursor = SetClassWord(PicturehWnd(15), GCW_HCURSOR, CursHandle(70 + LastTMP))
  589.     LastTMP = LastTMP + 1
  590.      Else
  591.     LastTMP = 0
  592.      End If
  593. Case PicturehWnd(16):
  594.      If LastTMP < 4 Then
  595.     LastCursor = SetClassWord(PicturehWnd(16), GCW_HCURSOR, CursHandle(79 + LastTMP))
  596.     LastTMP = LastTMP + 1
  597.      Else
  598.     LastTMP = 0
  599.      End If
  600. Case PicturehWnd(17):
  601.      LastCursor = SetClassWord(PicturehWnd(17), GCW_HCURSOR, CursHandle(84))
  602. Case PicturehWnd(18):
  603.      LastCursor = SetClassWord(PicturehWnd(18), GCW_HCURSOR, CursHandle(85))
  604. Case PicturehWnd(19):
  605.      LastCursor = SetClassWord(PicturehWnd(19), GCW_HCURSOR, CursHandle(86))
  606. Case PicturehWnd(20):
  607.      LastCursor = SetClassWord(PicturehWnd(20), GCW_HCURSOR, CursHandle(87))
  608. Case PicturehWnd(21):
  609.      LastCursor = SetClassWord(PicturehWnd(21), GCW_HCURSOR, CursHandle(88))
  610. Case PicturehWnd(22):
  611.      If LastTMP < 8 Then
  612.      LastCursor = SetClassWord(PicturehWnd(22), GCW_HCURSOR, CursHandle(91 + LastTMP))
  613.      LastTMP = LastTMP + 1
  614.      Else
  615.      LastTMP = 0
  616.      End If
  617. Case PicturehWnd(23):
  618.      If LastTMP < 10 Then
  619.      LastCursor = SetClassWord(PicturehWnd(23), GCW_HCURSOR, CursHandle(99 + LastTMP))
  620.      LastTMP = LastTMP + 1
  621.      Else
  622.      LastTMP = 0
  623.      End If
  624. Case PicturehWnd(24):
  625.      LastCursor = SetClassWord(PicturehWnd(24), GCW_HCURSOR, CursHandle(109))
  626. Case PicturehWnd(25):
  627.      LastCursor = SetClassWord(PicturehWnd(25), GCW_HCURSOR, CursHandle(110))
  628. Case PicturehWnd(26):
  629.      LastCursor = SetClassWord(PicturehWnd(26), GCW_HCURSOR, CursHandle(111))
  630. Case PicturehWnd(27):
  631.      LastCursor = SetClassWord(PicturehWnd(27), GCW_HCURSOR, CursHandle(112))
  632. Case PicturehWnd(28):
  633.      LastCursor = SetClassWord(PicturehWnd(28), GCW_HCURSOR, CursHandle(113))
  634. End Select
  635. 'Redisplay cursor for animation
  636. Ret% = SetCursorPos(p.x, p.y)
  637. 'Write the cursor position in Label1
  638. Form1.Label1.Caption = "Position" + Chr$(13) + "X:" + Str$(p.x) + Chr$(13) + "Y:" + Str$(p.y)
  639. End Sub
  640.