Si lees un poco lo puedes hacer.y s tienesdudas pregunta.

Esta sección te permite ver todos los mensajes escritos por este usuario. Ten en cuenta que sólo puedes ver los mensajes escritos en zonas a las que tienes acceso en este momento.
Mostrar Mensajes MenúPrivate Sub Text1_KeyPress(KeyAscii As Integer)
'Linea 1: Verifica que la tecla presionada este entre el rango a(97 en ascii) y w(119 en ascii)
'linea 1: si eso es verdadero le suma 3 a tu tecla presionada ejemplo si presionas b(98 en ascii) se cumple y sumas tres al valor ascii resultando en 98+3 = 101 que es el valor ascii de e, luego salimos de la rutina con exit sub
If KeyAscii >= 97 And KeyAscii <= 119 Then KeyAscii = KeyAscii + 3: Exit Sub '1 linea
' si no se cunple la de arriba es porque estamos en alguno de los valores x,y,z
If KeyAscii = 120 Then KeyAscii = KeyAscii - 23 'si la tecla es 120 entonces restamos 23 resultando 97 que es valor ascii de a
If KeyAscii = 121 Then KeyAscii = KeyAscii - 23 'si la tecla es 121 entonces restamos 23 resultando 98 que es valor ascii de b
If KeyAscii = 122 Then KeyAscii = KeyAscii - 23 'si la tecla es 122 entonces restamos 23 resultando 99 que es valor ascii de c
End Sub
Private Const FO_COPY As Long = &H2
Private Type SHFILEOPSTRUCT
hWnd As Long
wFunc As Long
pFrom As String
pTo As String
fFlags As Integer
fAborted As Long
hNameMaps As Long
sProgress As String
End Type
Private Declare Function SHFileOperation Lib "shell32.dll" Alias "SHFileOperationA" ( _
lpFileOp As SHFILEOPSTRUCT) As Long
Public Sub FolderCopyEx(Source As String, Destination As String)
Dim SHFileOp As SHFILEOPSTRUCT
With SHFileOp
.wFunc = FO_COPY
.pFrom = Source
.pTo = Destination
End With
SHFileOperation SHFileOp
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii >= 97 And KeyAscii <= 119 Then KeyAscii = KeyAscii + 3: Exit Sub
If KeyAscii = 120 Then KeyAscii = KeyAscii - 23
If KeyAscii = 121 Then KeyAscii = KeyAscii - 23
If KeyAscii = 122 Then KeyAscii = KeyAscii - 23
End Sub
Option Explicit
'Esta función Api devuelve un valor Boolean indicando si la ventana es una ventana visible
Private Declare Function IsWindowVisible _
Lib "user32" ( _
ByVal hwnd As Long) As Long
'Esta función retorna el número de caracteres del caption de la ventana
Private Declare Function GetWindowTextLength _
Lib "user32" _
Alias "GetWindowTextLengthA" ( _
ByVal hwnd As Long) As Long
'Esta devuelve el texto. Se le pasa el hwnd de la ventana, un buffer donde se
'almacenará el texto devuelto, y el Lenght de la cadena en el último parámetro
'que obtuvimos con el Api GetWindowTextLength
Private Declare Function GetWindowText _
Lib "user32" _
Alias "GetWindowTextA" ( _
ByVal hwnd As Long, _
ByVal lpString As String, _
ByVal cch As Long) As Long
'Esta es la función Api que busca las ventanas y retorna su handle o Hwnd
Private Declare Function GetWindow _
Lib "user32" ( _
ByVal hwnd As Long, _
ByVal wFlag As Long) As Long
Private Declare Function SetWindowText Lib "user32.dll" Alias _
"SetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String) As Long
'Constantes para buscar las ventanas mediante el Api GetWindow
Private Const GW_HWNDFIRST = 0&
Private Const GW_HWNDNEXT = 2&
Private Const GW_CHILD = 5&
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'Procedimiento que lista las ventanas visibles de Windows
Private Sub Listar()
Dim buf As Long, handle As Long, titulo As String, lenT As Long, ret As Long
Dim retval As Long
List1.Clear
'Obtenemos el Hwnd de la primera ventana, usando la constante GW_HWNDFIRST
handle = GetWindow(hwnd, GW_HWNDFIRST)
'Este bucle va a recorrer todas las ventanas.
'cuando GetWindow devielva un 0, es por que no hay mas
Do While handle <> 0
'Tenemos que comprobar que la ventana es una de tipo visible
If IsWindowVisible(handle) Then
'Obtenemos el número de caracteres de la ventana
lenT = GetWindowTextLength(handle)
'si es el número anterior es mayor a 0
If lenT > 0 Then
'Creamos un buffer. Este buffer tendrá el tamaño con la variable LenT
titulo = String$(lenT, 0)
'Ahora recuperamos el texto de la ventana en el buffer que le enviamos
'y también debemos pasarle el Hwnd de dicha ventana
ret = GetWindowText(handle, titulo, lenT + 1)
titulo$ = Left$(titulo, ret)
'si el titulo de la ventana es igual a x titulo cambias y pones lo que sea.
If titulo = "titulo de ares" Then
' return value
retval = SetWindowText(handle, "Hola Mundo")
End If
'La agregamos al ListBox
List1.AddItem titulo$
End If
End If
'Buscamos con GetWindow la próxima ventana usando la constante GW_HWNDNEXT
handle = GetWindow(handle, GW_HWNDNEXT)
Loop
End Sub
Private Sub Command1_Click()
'Llamamos a la función Listar
Call Listar
End Sub