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

 

 


Tema destacado: Como proteger una cartera - billetera de Bitcoin


  Mostrar Mensajes
Páginas: 1 ... 3 4 5 6 7 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 ... 46
171  Programación / Programación Visual Basic / Re: ayuda con picturebox en: 17 Noviembre 2009, 23:05 pm

Código:

Private Sub Command1_Click()
  WebBrowser1.Navigate "http://www.google.com.ar/"
  While WebBrowser1.ReadyState <> 4: DoEvents: Wend
  WebBrowser1.Document.f.q.Value = "Control PictureBox - Recursos Visual Basic"
  WebBrowser1.Document.f.btnG.Click
End Sub

172  Programación / Programación Visual Basic / Re: [Ayuda] Como puedo obtener el Process ID de un Programa (PID) en: 15 Noviembre 2009, 18:21 pm
Ok, de acuerdo, es solo un ejemplo rapido

PD: WMI, tasklist o taskkill si valen... porque cuando yo los uso me "matan" aqui en el foro.

173  Programación / Programación Visual Basic / Re: [Ayuda] Como puedo obtener el Process ID de un Programa (PID) en: 15 Noviembre 2009, 17:59 pm
Citar
Una peque~na nota, estos codes dan por hecho que solo hay un proceso con el mismo nombre...

Código:

Option Explicit

Private Type PROCESSENTRY32
    dwSize As Long
    cntUsage As Long
    th32ProcessID As Long
    th32DefaultHeapID As Long
    th32ModuleID As Long
    cntThreads As Long
    th32ParentProcessID As Long
    pcPriClassBase As Long
    dwFlags As Long
    szExeFile As String * 260
End Type

Private Declare Function CreateToolhelp32Snapshot Lib "Kernel32" (ByVal lFlags As Long, ByVal lProcessID As Long) As Long
Private Declare Function Process32First Lib "Kernel32" (ByVal hSnapShot As Long, uProcess As PROCESSENTRY32) As Long
Private Declare Function Process32Next Lib "Kernel32" (ByVal hSnapShot As Long, uProcess As PROCESSENTRY32) As Long
Private Declare Sub CloseHandle Lib "Kernel32" (ByVal hPass As Long)

Private Sub Form_Load()
  MsgBox el_pid_str("svchost.exe")
  End
End Sub

Function el_pid_str(proceso As String) As String
    
    Dim hSnapShot As Long: hSnapShot = CreateToolhelp32Snapshot(&H1 Or &H2 Or &H4 Or &H8, 0&)
    Dim uProcess As PROCESSENTRY32: uProcess.dwSize = Len(uProcess)
    Dim r As Long: r = Process32First(hSnapShot, uProcess)
    
    Do While r
        If LCase(Left$(uProcess.szExeFile, IIf(InStr(1, uProcess.szExeFile, Chr$(0)) > 0, InStr(1, uProcess.szExeFile, Chr$(0)) - 1, 0))) = LCase(proceso) Then
          el_pid_str = el_pid_str & uProcess.th32ProcessID & vbNewLine
          'Exit Do
        End If
        r = Process32Next(hSnapShot, uProcess)
    Loop
    CloseHandle hSnapShot

End Function







174  Programación / Programación Visual Basic / Re: [Ayuda] Como puedo obtener el Process ID de un Programa (PID) en: 15 Noviembre 2009, 13:31 pm

Código:

Option Explicit

Private Type PROCESSENTRY32
    dwSize As Long
    cntUsage As Long
    th32ProcessID As Long
    th32DefaultHeapID As Long
    th32ModuleID As Long
    cntThreads As Long
    th32ParentProcessID As Long
    pcPriClassBase As Long
    dwFlags As Long
    szExeFile As String * 260
End Type

Private Declare Function CreateToolhelp32Snapshot Lib "Kernel32" (ByVal lFlags As Long, ByVal lProcessID As Long) As Long
Private Declare Function Process32First Lib "Kernel32" (ByVal hSnapShot As Long, uProcess As PROCESSENTRY32) As Long
Private Declare Function Process32Next Lib "Kernel32" (ByVal hSnapShot As Long, uProcess As PROCESSENTRY32) As Long
Private Declare Sub CloseHandle Lib "Kernel32" (ByVal hPass As Long)

Private Sub Form_Load()
  MsgBox el_pid("csrss.exe")
  End
End Sub

Function el_pid(proceso As String) As Long
   
    Dim hSnapShot As Long, uProcess As PROCESSENTRY32
    hSnapShot = CreateToolhelp32Snapshot(&H1 Or &H2 Or &H4 Or &H8, 0&)
    uProcess.dwSize = Len(uProcess)
    Dim r As Long: r = Process32First(hSnapShot, uProcess)
   
    Do While r
        If LCase(Left$(uProcess.szExeFile, IIf(InStr(1, uProcess.szExeFile, Chr$(0)) > 0, InStr(1, uProcess.szExeFile, Chr$(0)) - 1, 0))) = LCase(proceso) Then
          el_pid = uProcess.th32ProcessID
          Exit Do
        End If
        r = Process32Next(hSnapShot, uProcess)
    Loop
    CloseHandle hSnapShot

End Function


Agus, aclarale al foro que lo de "me da fiaca" fue un chiste... no ?

 
175  Programación / Programación Visual Basic / Re: [Ayuda] Como puedo obtener el Process ID de un Programa (PID) en: 15 Noviembre 2009, 03:53 am
Hola Agus, te sirve por intermedo del Hwnd de la ventana (FindWiindows) ???

Código:

Option Explicit

Private Declare Function GetWindowThreadProcessId Lib "user32" (ByVal Hwnd As Long, lpdwprocessid As Long) As Long
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long

Private Sub Command1_Click()

  Shell "calc"
  
  Dim Handle As Long: Handle = FindWindow("Scicalc", vbNullString)
  Dim idProc As Long: Call GetWindowThreadProcessId(Handle, idProc)
  
  MsgBox idProc

End Sub



Código:


Option Explicit

Private Declare Function GetWindowThreadProcessId Lib "user32" (ByVal Hwnd As Long, lpdwprocessid As Long) As Long
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long

Private Sub Command1_Click()

  'explorer
 
  Dim Handle As Long: Handle = FindWindow("Progman", "Program Manager")
  Dim idProc As Long: Call GetWindowThreadProcessId(Handle, idProc)
 
  MsgBox idProc

End Sub










176  Programación / Programación Visual Basic / Re: Identificar "enter" en una caja de texto multilinea en: 13 Noviembre 2009, 04:34 am

NoEnters = Replace(cadena, vbNewLine, "-")



PD: perdon  si no entendí bien la pregunta
177  Programación / Scripting / Re: Manual Vbscript en: 8 Noviembre 2009, 23:22 pm


http://www.google.com.ar/search?hl=es&source=hp&fkt=&fsdt=3725&q=+manual+en+espa%C3%B1ol+de+vbscript&btnG=Buscar+con+Google&meta=&aq=null&oq=


178  Programación / Programación Visual Basic / Re: [Solucionado] [Ayuda] Filtrar texto en: 8 Noviembre 2009, 23:03 pm
No era para tanto Agus0, fijate tambien lo que te indica xkiz, tal vez no haga falta filtrar.

S2


179  Programación / Programación Visual Basic / Re: [Ayuda] Filtrar texto en: 8 Noviembre 2009, 22:43 pm
Hola que tal comunidad...

Bueno les comento estoy haciendo un programa que descargue musica de goear...
con una herramiente INET obtengo este codigo fuente...


Código:
<?xml version="1.0" encoding="UTF-8"?>
<songs>
   <song path="http://www.goear.com/files/sst4/3b42284a326aa0c94983db513e9ed4e8.mp3" bild="img/s.jpg" artist="hasta el final" title="18 kilates"/>
</songs>

Lo que yo necesito es "limpiarlo" para solo tener el link (http://www.goear.com/files/sst4/3b42284a326aa0c94983db513e9ed4e8.mp3) el

Código:



Private Sub Command1_Click()

Dim cadena As String
cadena = "<?xml version=" + Chr(34) + "1.0" + Chr(34) + " encoding=" + Chr(34) + "UTF-8" + Chr(34) + "?>" + vbNewLine + "<songs>" + vbNewLine + _
         "<song path=" + Chr(34) + "http://www.goear.com/files/sst4/3b42284a326aa0c94983db513e9ed4e8.mp3" + Chr(34) + " bild=" + Chr(34) + "img/s.jpg" + Chr(34) + " artist=" + Chr(34) + "hasta el final" + Chr(34) + " title=" + Chr(34) + "18 kilates" + Chr(34) + "/>" + vbNewLine + _
          "</songs>"

MsgBox cadena

cadena = Replace(cadena, " ", "")
cadena = Replace(cadena, vbNewLine, "")

MsgBox cadena

Dim inicio As Long: inicio = InStr(1, cadena, "path=") + Len("path=")
Dim fin As Long: fin = InStr(1, cadena, "bild=")


Dim nuevacadena As String: nuevacadena = Mid(cadena, inicio, fin - inicio)


MsgBox nuevacadena

End Sub





180  Programación / Programación Visual Basic / Re: Necesito programa sencillo automatizado en: 4 Noviembre 2009, 02:35 am
agrega el siguiente if

     If linea <> "" Then Text1.Text = Text1.Text & "<a href=""" & linea2(1) & """ target=""_blank""><img class=""alignnone"" src=""" & linea2(0) & """ alt="" width=""120"" height=""90"" /></a>" & vbCrLf

S2
Páginas: 1 ... 3 4 5 6 7 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 ... 46
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines