Programación General > Visual Basic 6.0 e inferiores

 Sendkeys

<< < (2/2)

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 &#34;kernel32&#34; (ByVal dwMilliseconds As Long)Public Const GW_HWNDNEXT = 2 Public Declare Function GetParent Lib &#34;user32&#34; (ByVal hwnd As Long) As LongPublic Declare Function GetWindow Lib &#34;user32&#34; (ByVal hwnd As Long, ByVal wCmd As Long) As LongPublic Declare Function FindWindow Lib &#34;user32&#34; Alias &#34;FindWindowA&#34; (ByVal lpClassName As String, ByVal lpWindowName As String) As LongPublic Declare Function GetWindowText Lib &#34;user32&#34; Alias &#34;GetWindowTextA&#34; (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As LongPublic Declare Function GetWindowThreadProcessId Lib &#34;user32&#34; (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(&#34;c:&#092;demo&#092;otro.exe&#34;) 'yo aca puse este form que me llama un msgbox con yes / no  y lo cancelo con el sendkeys        hWndApp = GetWinHandle(hInst)      If hWndApp &#60;&#62; 0 Then      ' Init buffer      buffer = Space&#036;(128)            numChars = GetWindowText(hWndApp, buffer, Len(buffer))          SendKeys &#34;%{N}&#34; 
Espero les sirva

Navegación

[0] Índice de Mensajes

[*] Página Anterior

Ir a la versión completa