Ver Mensaje Individual
  #2 (permalink)  
Antiguo 07/01/2002, 02:32
compaq
 
Fecha de Ingreso: diciembre-2001
Mensajes: 26
Antigüedad: 23 años, 4 meses
Puntos: 0
Re: Ayuda urgente!! VISUAL BASIC

Inserta dos formularios y pon este codPrivate Sub Form_Load()

1º Pones

' Move the form to the bottom right
' corner of the screen
Me.Left = Screen.Width - Me.Width
Me.Top = Screen.Height - Me.Height

' Make the picture box take up the entire form
picZoom.Move 0, 0, Me.ScaleWidth, Me.ScaleHeight

' Initialize the zooming functions
Call LoadSettings

End Sub

Private Sub tmrZoom_Timer()

Dim lRet As Long
Dim ptMouse As PointAPI

Static lElapsed As Long

If Me.WindowState <> vbMinimized Then
'This code runs 20 times/second*, while the form is not minimized.
lElapsed = lElapsed + tmrZoom.Interval
lRet = GetCursorPos(ptMouse)
With ptMouse
If (.X <> mlOldX) Or (.Y <> mlOldY) Or (lElapsed >= 250) Then
'This code runs runs 4 times/second* if no mousemove,
'or 20 times/second* when mouse is moving.
Call DoZoom(ptMouse)
If lElapsed >= 250 Then
'This code only runs 4 times/second*.
lRet = SetWindowPos(Me.hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_FLAGS)
End If
lElapsed = 0
End If
mlOldX = .X
mlOldY = .Y
End With
End If

'* Times/second depends on processor speed. A slower processor may not
'finish processing one timer event before the next arrives, in which
'case the new event will be discarded.

End Sub

2º form

' Color Spy Example
' By Chetan Sarva ([email protected]), May 2000
' - Original by Plastik ([email protected])
' - Zoom by Rocky Clark

Option Explicit

'declares
Private Declare Function GetCursorPos Lib "user32" (lpPoint As PointAPI) As Long
Private Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function GetPixel Lib "gdi32" (ByVal hDC As Long, ByVal X As Long, ByVal Y As Long)