Programación General > Visual Basic 6.0 e inferiores
Sendkeys
Epa:
Buenas.
Cuando te salga la alerta, puedes intentar cojer su handle con la api findwindow y luego mandarle una pulsacion con postmessage.
Saludos :hola:
ElNapster:
:D tendras un ejemplin por alli ?
:rolleyes:
Thnks
Epa:
Aqui hay un pequeño ejemplo.
No es de lo mejor xD ya que usa un timer, pero puede servir.
Saludos :hola:
---
Esto no deja adjuntar rars <_<
ElNapster:
Sulicionado compañeros !!!!!!!
les pongo el codigo por si a alguien le interesa
En un Modulo
--- Código: Text ---Public Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)Public Const GW_HWNDNEXT = 2 Public Declare Function GetParent Lib "user32" (ByVal hwnd As Long) As LongPublic Declare Function GetWindow Lib "user32" (ByVal hwnd As Long, ByVal wCmd As Long) As LongPublic Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As LongPublic Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As LongPublic Declare Function GetWindowThreadProcessId Lib "user32" (ByVal hwnd As Long, lpdwprocessid As Long) As Long Function ProcIDFromWnd(ByVal hwnd As Long) As Long Dim idProc As Long GetWindowThreadProcessId hwnd, idProc ProcIDFromWnd = idProcEnd Function Function GetWinHandle(hInstance As Long) As Long Dim tempHwnd As Long tempHwnd = FindWindow(vbNullString, vbNullString) Do Until tempHwnd = 0 If GetParent(tempHwnd) = 0 Then If hInstance = ProcIDFromWnd(tempHwnd) Then GetWinHandle = tempHwnd Exit Do End If End If tempHwnd = GetWindow(tempHwnd, GW_HWNDNEXT) LoopEnd Function
Form (colocar un boton)
--- Código: Text --- Dim hInst As Long Dim hWndApp As Long Dim buffer As String Dim numChars As Integer Sleep 3000 hInst = Shell("c:\demo\otro.exe") 'yo aca puse este form que me llama un msgbox con yes / no y lo cancelo con el sendkeys hWndApp = GetWinHandle(hInst) If hWndApp <> 0 Then ' Init buffer buffer = Space$(128) numChars = GetWindowText(hWndApp, buffer, Len(buffer)) SendKeys "%{N}"
Espero les sirva
Navegación
[*] Página Anterior
Ir a la versión completa