elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Recopilación Tutoriales y Manuales Hacking, Seguridad, Privacidad, Hardware, etc


  Mostrar Mensajes
Páginas: 1 ... 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 [23] 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 ... 46
221  Programación / Programación Visual Basic / Re: Duda sobre clicar en "pantalla" VB en: 2 Agosto 2009, 23:40 pm
Algo asì ? (no se si te va a servir en tu caso)

Código:

Option Explicit

Private Declare Function PostMessage Lib "user32" Alias "PostMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Private Const WM_ENTER = &HD: Private Const WM_CHAR = &H102

Public Sub Clicar(lHwnd As Long, x As Long, y As Long)
  Dim Rst As Long: Dim Prm As Long
  Prm = y + x
  Rst = PostMessage(lHwnd, WM_CHAR, vbKeySpace, ByVal Prm)
End Sub

Private Sub Command1_Click()
  Call Clicar(Text1.hwnd, 1, 1)
End Sub
Private Sub Command2_Click()
  Call Clicar(Text1.hwnd, 1, 10)
End Sub

Private Sub Form_Load()
Text1 = "X"
End Sub



S2

EDIT: para el tabulador seria vbKeyTab en lugar de vbKeySpace

222  Programación / Programación Visual Basic / Re: Duda sobre clicar en "pantalla" VB en: 1 Agosto 2009, 15:56 pm
Tambien probá si te sirve esta otra opcion:

las coordenadas que quieras en lugar de 1,1

Código:

Option Explicit

Private Declare Function PostMessage Lib "user32" Alias "PostMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Const WM_LBUTTONDOWN = &H201: Const WM_LBUTTONUP = &H202

Public Sub Clicar(lHwnd As Long, x As Long, y As Long)

Dim Rst As Long
Dim Prm As Long

Prm = y + x
Rst = PostMessage(lHwnd, WM_LBUTTONDOWN, 0&, ByVal Prm)
Rst = PostMessage(lHwnd, WM_LBUTTONUP, 0&, ByVal Prm)

End Sub


Private Sub Command1_Click()

Call Clicar(WebBrowser1.hwnd, 1, 1)

End Sub


S2
223  Programación / Programación Visual Basic / Re: Leer el valor de los campos de otro programa en: 1 Agosto 2009, 12:50 pm
Dejo un ejemplo simple del uso de SendMessage + WM_GETTEXT para el que le sirva.

Nota: no hace falta usar un timer es solo para facilitar el concepto

Código:

Option Explicit

Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
Private Declare Function SendMessage Lib "user32.dll" Alias "SendMessageA" (ByVal hwnd As Long, ByVal Msg As Long, wParam As Any, lParam As Any) As Long
Private Const WM_GETTEXT = &HD: Private Const WM_SETTEXT = &HC

Private Sub Form_Load()
  Timer1.Interval = 16
  Me.AutoRedraw = True
  Shell "calc"
End Sub

Private Sub Timer1_Timer()
  Dim Hwndl As Long
  Hwndl = FindWindow("SciCalc", vbNullString)
  Hwndl = FindWindowEx(Hwndl, 0, "Edit", vbNullString)

  Dim recibir As String: recibir = Space$(34)
  Call SendMessage(Hwndl, WM_GETTEXT, ByVal 34, ByVal recibir)

  Me.Cls
  'Me.Print recibir
  Me.Print Replace(recibir, vbNullChar, "")
End Sub


S2
224  Programación / Programación Visual Basic / Re: Leer el valor de los campos de otro programa en: 29 Julio 2009, 23:24 pm
SendMessage con sETTEXT para enviar y SendMessage con GETTEXT para recibir.

http://foro.elhacker.net/programacion_vb/pasar_variables_por_memoria_src-t244803.0.html

S2
225  Programación / Programación Visual Basic / Re: Como mostrar y/o maximizar una instancia previa del mismo exe? en: 20 Julio 2009, 19:08 pm
Algo así ?

Código:

Option Explicit

Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function SetForegroundWindow Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
Private Declare Function IsIconic Lib "user32" (ByVal hwnd As Long) As Long
Const SW_NORMAL = 1



Private Sub Form_Load()

Me.Caption = "INSTANCIA 1"

If App.PrevInstance Then
Me.Caption = "INSTANCIA 2"
MsgBox "NO", , Me.Caption

 If IsIconic(FindWindow(vbNullString, "INSTANCIA 1")) = 0 Then
    MsgBox "no esta minimizado"
    Call SetForegroundWindow(FindWindow(vbNullString, "INSTANCIA 1"))
 Else
    MsgBox "esta minimizado"
    Call ShowWindow(FindWindow(vbNullString, "INSTANCIA 1"), SW_NORMAL)
    Call SetForegroundWindow(FindWindow(vbNullString, "INSTANCIA 1"))
 End If
End
End If


End Sub



S2

226  Programación / Programación Visual Basic / Re: SetWindowPos? en Cualquier control? en: 20 Julio 2009, 18:36 pm
En cuanto pongas la propiedad del formulario BorderStyle en "0" (cero) no te aparece mas el mensaje

En diseño (antes de ejecutar el code)

S2

227  Programación / Programación Visual Basic / Re: SetWindowPos? en Cualquier control? en: 20 Julio 2009, 18:05 pm
Código:

Option Explicit

Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long

Private Sub Form_Load()
 
  Call SetWindowPos(Me.hwnd, -1, 0, 0, 0, 0, &H2 Or &H1)
 
 ' todas estas propiedades en diseño
 If Me.BorderStyle <> 0 Then MsgBox "FORM SIN BORDES EN DISEÑO": End
 Command1.Left = 0
 Command1.Top = 0
 Me.Height = Command1.Height
 Me.Width = Command1.Width

End Sub


Private Sub Command1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)

If Button = 1 Then
 MsgBox "CODIGO"
End If
If Button = 2 Then
 End
End If

End Sub


S2
228  Programación / Programación Visual Basic / Re: Ayuda con parte de codigo en: 20 Julio 2009, 05:30 am
Yo para dos strings uso el "+" porque tengo la tecla mas cerca ...
229  Programación / Programación Visual Basic / Re: Ayuda con parte de codigo en: 20 Julio 2009, 04:14 am
 ;)

230  Programación / Programación Visual Basic / Re: Ayuda con parte de codigo en: 20 Julio 2009, 04:09 am
 FileName = App.Path + "\imagen.bmp"


S2
Páginas: 1 ... 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 [23] 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 ... 46
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines