home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Programming Tool Box
/
SIMS_2.iso
/
code
/
system
/
api_mo~1
/
form1.frm
< prev
next >
Wrap
Text File
|
1995-02-27
|
6KB
|
225 lines
VERSION 2.00
Begin Form Form1
Caption = "Mouse-API"
ClientHeight = 3495
ClientLeft = 5175
ClientTop = 3495
ClientWidth = 3270
Height = 3900
Left = 5115
LinkTopic = "Form1"
ScaleHeight = 3495
ScaleWidth = 3270
Top = 3150
Width = 3390
Begin CommandButton Command4
Caption = "HideCursor"
Height = 552
Left = 72
TabIndex = 13
Top = 2808
Width = 1416
End
Begin Timer Timer2
Interval = 10
Left = 2844
Top = 2232
End
Begin CommandButton Command3
Caption = "Record"
Height = 516
Left = 72
TabIndex = 12
Top = 2088
Width = 1452
End
Begin CommandButton Command2
Caption = "ClipCursor"
Height = 516
Left = 1836
TabIndex = 11
Top = 2088
Width = 1056
End
Begin Frame Frame2
Caption = "SetCursorPos"
Height = 948
Left = 36
TabIndex = 5
Top = 1044
Width = 2964
Begin CommandButton Command1
Caption = "SetCursor"
Height = 516
Left = 1800
TabIndex = 6
Top = 288
Width = 984
End
Begin TextBox TxtY
Height = 288
Left = 432
TabIndex = 7
Text = "100"
Top = 576
Width = 840
End
Begin TextBox TxtX
Height = 288
Left = 432
TabIndex = 10
Text = "100"
Top = 252
Width = 840
End
Begin Label Label6
Caption = "X:"
Height = 228
Left = 108
TabIndex = 9
Top = 252
Width = 336
End
Begin Label Label5
Caption = "Y:"
Height = 264
Left = 108
TabIndex = 8
Top = 576
Width = 336
End
End
Begin Frame Frame1
Caption = "GetCursorPos"
Height = 876
Left = 36
TabIndex = 2
Top = 72
Width = 1452
Begin Label LblY
Height = 192
Left = 396
TabIndex = 0
Top = 540
Width = 1020
End
Begin Label LblX
Height = 228
Left = 396
TabIndex = 1
Top = 252
Width = 912
End
Begin Label Label2
Caption = "Y:"
Height = 264
Left = 108
TabIndex = 4
Top = 540
Width = 336
End
Begin Label Label1
Caption = "X:"
Height = 228
Left = 108
TabIndex = 3
Top = 252
Width = 336
End
End
Begin Timer Timer1
Interval = 50
Left = 2664
Top = 288
End
End
Option Explicit
Dim RecordlpRect(5000) As PointAPI
Dim Zaehler As Integer
Sub Command1_Click ()
SetCursorPos CInt(TxtX), CInt(TxtY)
End Sub
Sub Command2_Click ()
Dim lpRect As Rect
Static lpAltRect As Rect
If Command2.Caption = "ClipCursor" Then
' merke Clipbereich
GetClipCursor lpAltRect
' setze neuen Clipbereich
GetWindowRect Hwnd, lpRect
ClipCursor lpRect
Command2.Caption = "Reset Clip"
Else
ClipCursor lpAltRect
Command2.Caption = "ClipCursor"
End If
End Sub
Sub Command3_Click ()
Dim I As Integer
Select Case Command3.Caption
Case Is = "Record"
Zaehler = 0
Erase RecordlpRect
Command3.Caption = "Stop"
Timer2.Enabled = True
Case Is = "Stop"
Timer2.Enabled = False
Command3.Caption = "Play"
Case Is = "Play"
For I = 1 To Zaehler
SetCursorPos RecordlpRect(I).X, RecordlpRect(I).Y
Wait 1500
Next I
Command3.Caption = "Record"
End Select
End Sub
Sub Command4_Click ()
Dim Dummy As Integer
Dim I As Integer
Dummy = ShowCursor(0)
For I = 1 To 500
Wait 100
Next I
Dummy = ShowCursor(1)
End Sub
' Anzeigen der Mousekoordinaten mit "GetCursorPos"
Sub Timer1_Timer ()
Dim lpPoint As PointAPI
GetCursorPos lpPoint
LblX = lpPoint.X
LblY = lpPoint.Y
End Sub
Sub Timer2_Timer ()
Zaehler = Zaehler + 1
GetCursorPos RecordlpRect(Zaehler)
End Sub
Sub Wait (Zeit)
Dim I As Integer
For I = 1 To Zeit
DoEvents
Next I
End Sub