Limit Mouse

April 26, 2008

Option Explicit

Private Type RECT
   left                 As Integer
   top                  As Integer
   right                As Integer
   bottom               As Integer
End Type

Private Type POINT
   x                    As Long
   y                    As Long
End Type

Private Declare Sub ClipCursor Lib “user32″ (lpRect As Any)
Private Declare Sub GetClientRect Lib “user32″ (ByVal hWnd As _
      Long, lpRect As RECT)
Private Declare Sub ClientToScreen Lib “user32″ (ByVal hWnd As _
      Long, lpPoint As POINT)
Private Declare Sub OffsetRect Lib “user32″ (lpRect As RECT, _
       ByVal x As Long, ByVal y As Long)
Public Sub LimitCursorMovement(ctl As Object)
  
   Dim client           As RECT
   Dim upperleft        As POINT
   Dim lHwnd As Long
   On Error Resume Next
   lHwnd = ctl.hWnd
   If lHwnd = 0 Then Exit Sub
   GetClientRect ctl.hWnd, client
   upperleft.x = client.left
   upperleft.y = client.top
   ClientToScreen ctl.hWnd, upperleft
   OffsetRect client, upperleft.x, upperleft.y
   ClipCursor client
End Sub

Public Sub ReleaseLimit()
   ‘Releases the cursor limits
   ‘Be sure to call on unloading the form
   ClipCursor ByVal 0&
End Sub

Private Sub cmdNormal_Click()
  ReleaseLimit
End Sub

Private Sub cmdSetLimit_Click()
  LimitCursorMovement Me
End Sub

Private Sub Form_Load()
  ReleaseLimit
 
End Sub

Private Sub Form_Unload(Cancel As Integer)
  ReleaseLimit
End Sub

Spalsh Screen

April 26, 2008

Option Explicit

Private Sub Form_KeyPress(KeyAscii As Integer)
    Unload Me
End Sub

Private Sub Form_Load()
   ‘ lblVersion.Caption = “Version ” & App.Major & “.” & App.Minor & “.” & App.Revision
  ‘  lblProductName.Caption = App.Title
End Sub

Private Sub Frame1_Click()
    Unload Me
End Sub

Private Sub Timer1_Timer()
Dim counter As Double
counter = 0
Do
    counter = counter + 0.005
    Label2.Width = counter
Loop While Not (Label1.Width = Label2.Width)
frmSplash.Hide
Form5.Show
Timer1.Enabled = False
End Sub