home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Begin VB.Form Form1
- Caption = "Mouse Position"
- ClientHeight = 1575
- ClientLeft = 60
- ClientTop = 330
- ClientWidth = 3630
- LinkTopic = "Form1"
- ScaleHeight = 1575
- ScaleWidth = 3630
- StartUpPosition = 3 'Windows Default
- Begin VB.Label LabelY
- Caption = "Label"
- Height = 375
- Left = 2040
- TabIndex = 2
- Top = 840
- Width = 1215
- End
- Begin VB.Label Label2
- Caption = "Mouse Position"
- Height = 255
- Left = 240
- TabIndex = 1
- Top = 240
- Width = 2055
- End
- Begin VB.Label LabelX
- Caption = "Label"
- Height = 375
- Left = 240
- TabIndex = 0
- Top = 840
- Width = 1215
- End
- Attribute VB_Name = "Form1"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Option Explicit
- Private Type POINTAPI
- X As Long
- Y As Long
- End Type
- Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
- Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
- Dim MouseLoc As POINTAPI
- Dim retValue As Boolean
- retValue = GetCursorPos(MouseLoc)
- LabelX.Caption = "X Pos = " & MouseLoc.X
- LabelY.Caption = "Y Pos = " & MouseLoc.Y
- End Sub
-