Ver Mensaje Individual
  #14 (permalink)  
Antiguo 21/08/2008, 09:41
Avatar de moradazo
moradazo
 
Fecha de Ingreso: julio-2008
Ubicación: [email protected]
Mensajes: 355
Antigüedad: 15 años, 10 meses
Puntos: 2
Respuesta: Visual Basic 2005. Salvar archivos desde Visual Basic.

Ya encontre la forma para activar botones con el keybd_event

Esta direccion tiene todas las formas de activar los diversos botones http://thedotnet.com/nntp/47170/showpost.aspx

David aca tengo este codigo:

Código PHP:
Public Class Form1
    Dim stopWatch 
As New Stopwatch
    
Private Const VK_LCONTROL = &HA2
    
Private Const VK_S = &H53
    
Private Const VK_TAB = &H9
    
Private Const VK_SPACE = &H20
    
Private Declare Sub keybd_event Lib "user32" (ByVal bVk As ByteByVal bScan As Byte_
            ByVal dwFlags 
As Long_
            ByVal dwExtraInfo 
As Long)


    Private Const 
VK_SNAPSHOT = &H2C

    
Private Sub Button1_Click(ByVal sender As System.ObjectByVal e As System.EventArgsHandles Button1.Click
        Command1_Click
()
    
End Sub

    
Private Sub Command1_Click()
        
keybd_event(VK_SNAPSHOT100)
        
keybd_event(VK_LCONTROL VK_S100)
        
keybd_event(VK_TAB100)
        
keybd_event(VK_SPACE100)
    
End Sub

    
Private Sub TimerCrono_Tick(ByVal sender As System.ObjectByVal e As System.EventArgsHandles Timer1.Tick
        
If stopWatch.IsRunning Then
            Dim ts 
As TimeSpan stopWatch.Elapsed
            Me
.textbox1.Text String.Format("{0:00}:{1:00}:{2:00}.{3:00}"ts.Hoursts.Minutests.Secondsts.Milliseconds 10)
        
End If
    
End Sub
End 
Class 
Si corro este codigo, cuando oprimo el boton para activarlo obviamente va a funcionar las teclas (Ctrl+S,Tab,Space) que le puse en la ventana donde oprimi el boton.

Si ves puse un timer esta listo para solo agregarle un StopWatch.start() y empieza a caminar, lo que no se es como hacer para que cada 5 minutos se ejecute esta herramienta.

Gracias por la ayuda