home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / movemo1a / form1.frm (.txt) next >
Encoding:
Visual Basic Form  |  1998-10-09  |  1.2 KB  |  45 lines

  1. VERSION 5.00
  2. Begin VB.Form Form1 
  3.    Caption         =   "Form1"
  4.    ClientHeight    =   3195
  5.    ClientLeft      =   3105
  6.    ClientTop       =   2325
  7.    ClientWidth     =   4635
  8.    LinkTopic       =   "Form1"
  9.    PaletteMode     =   1  'UseZOrder
  10.    ScaleHeight     =   213
  11.    ScaleMode       =   3  'Pixel
  12.    ScaleWidth      =   309
  13.    Begin VB.CommandButton Command1 
  14.       Caption         =   "Move Mouse to shape"
  15.       Height          =   495
  16.       Left            =   240
  17.       TabIndex        =   0
  18.       Top             =   240
  19.       Width           =   1890
  20.    End
  21.    Begin VB.Shape Target 
  22.       Height          =   345
  23.       Left            =   3900
  24.       Shape           =   3  'Circle
  25.       Top             =   2655
  26.       Width           =   540
  27.    End
  28. Attribute VB_Name = "Form1"
  29. Attribute VB_GlobalNameSpace = False
  30. Attribute VB_Creatable = False
  31. Attribute VB_PredeclaredId = True
  32. Attribute VB_Exposed = False
  33. Option Explicit
  34. Sub MoveMouse(x As Single, y As Single)
  35. Dim pt As POINTAPI
  36.     pt.x = x
  37.     pt.y = y
  38.     ClientToScreen hwnd, pt
  39.     SetCursorPos pt.x, pt.y
  40. End Sub
  41. Private Sub Command1_Click()
  42.     MoveMouse Target.Left + Target.Width / 2, _
  43.               Target.Top + Target.Height / 2
  44. End Sub
  45.