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

 

 


Tema destacado: Trabajando con las ramas de git (tercera parte)


  Mostrar Mensajes
Páginas: 1 ... 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
201  Programación / PHP / Ayuda con array de plantillas. en: 24 Noviembre 2009, 15:11 pm
Tengo este codigo y quiero hacer que $contenido sea un array para poder seleccionar a que form enviar la informacion. hacer una especie de chat
Código:
<?
include("clase_plantilla.php");

$Contenido=new Plantilla("holaMundo");
$Contenido ->asigna_variables(array(
"IPLOCAL" => $_SERVER['REMOTE_ADDR'],
"IPDESTINO"=>$IPDESTINO,
"ENVIO"=>$ENVIO,
"LLEGADA"=>$LLEGADA
));


$ContenidoString = $Contenido->muestra();
echo $ContenidoString;
?>

Se puede?
Algo asi como $datos[datos + $_SERVER['REMOTE_ADDR']=$contenido]
202  Programación / PHP / Necesito usar templates(Plantillas). Ayuda con codigo. en: 19 Noviembre 2009, 17:49 pm
hola.
Necesito usar templates y no se como hacerlo y este codigo lo encontre en la web el cual quiero usar para iniciarme. Pero no me funciona.
Puede provarlo alguno para saver si es que tengo mal configurado el wamp-?

http://www.cristalab.com/files/ejemplos/templates/templates.zip


Y si es error del codigo... hechadme una mano.
203  Media / Multimedia / RAD VIDEO TOOLS ( BINK ) Ayuda a codificar. en: 17 Julio 2009, 12:52 pm
Buenas a todos.
Estoy intentando desarrollar un programa en vb.net para reducir juegos de pc y quiero usar el compresor de rad video tools mediante un batch para bajar la calidad de los videos.

No encuentro ejemplos en internet. Por eso acudo al foro.

El problema es que no se que switches (LAS OPCIONES) tengo que manejar ya que mis nociones de codificacion son nulas.
Espero que podais decirme cuales son las que tengo que usar para la compresion de sonido y video, como se usan y para que sirve.
Muchas gracias de antemano.


204  Programación / Programación Visual Basic / listar nombre de ventana de los procesos. No lo consigo. en: 10 Marzo 2009, 14:24 pm
Tengo ese problema, no consigo listar los nombres de las ventanas de los procesos

e intentado con:

Código:
dim recogidadedatos as string, handle as long
handle=openprocess( information or read,0, id)
getwindowtext(handle,recogidadedatos,100)
msgbox(recogidadedatos)

Pero parece que no encuentra el handle. Alguien me puede explicar el motivo?

A ˇˇ, En el proceso vb leido con openprocess me da un handle pero en otro programa me sale otro handle en el mismo proceso.

Este es el modulo que lista los procesos en un treeview y pone en handle el classname y las dependencias:
Código:
Public Function FillProcessListNT(treeview As MSComctlLib.treeview) As Long
    '=========================================================
    'Clears the listbox specified by the DestListBox parameter
    'and then fills the list with the processes and the
    'modules used by each process
    '=========================================================

    Dim cb                  As Long
    Dim cbNeeded            As Long
    Dim NumElements         As Long
    Dim ProcessIDs()        As Long
    Dim cbNeeded2           As Long
    Dim NumElements2        As Long
    Dim Modules(1 To 1024)  As Long
    Dim lRet                As Long
    Dim ModuleName          As String
    Dim nSize               As Long
    Dim hProcess            As Long
    Dim i                   As Long
    Dim sModName            As String
    Dim sChildModName       As String
    Dim iModDlls            As Long
    Dim iProcesses          As Integer
    Dim nodo(5)             As Node
   
   
    treeview.Nodes.Clear
     
     Set nodo(0) = treeview.Nodes.Add(, , , "Procesos en ejecucion")
               
    'Get the array containing the process id's for each process object
    cb = 8
    cbNeeded = 96
   
    'One important note should be made. Although the documentation
    'names the returned DWORD "cbNeeded", there is actually no way
    'to find out how big the passed in array must be. EnumProcesses()
    'will never return a value in cbNeeded that is larger than the
    'size of array value that you passed in the cb parameter.
   
    'if cbNeeded == cb upon return, allocate a larger array
    'and try again until cbNeeded is smaller than cb.
    Do While cb <= cbNeeded
       cb = cb * 2
       ReDim ProcessIDs(cb / 4) As Long
       lRet = EnumProcesses(ProcessIDs(1), cb, cbNeeded)
    Loop
   
    'calculate how many process IDs were returned
    NumElements = cbNeeded / 4
   
    For i = 1 To NumElements
   
        'Get a handle to the Process
        hProcess = OpenProcess(PROCESS_QUERY_INFORMATION _
            Or PROCESS_VM_READ, 0, ProcessIDs(i))

        ' Iterate through each process with an ID that <> 0
        If hProcess Then
           
            'Retrieve the number of bytes that the array of module handles requires
            lRet = EnumProcessModules(hProcess, Modules(1), 1024, cbNeeded2)
            'Get an array of the module handles for the specified process
            lRet = EnumProcessModules(hProcess, Modules(1), cbNeeded2, cbNeeded2)
           
            'If the Module Array is retrieved, Get the ModuleFileName
            If lRet <> 0 Then
               
                'Fill the ModuleName buffer with spaces
                ModuleName = Space(MAX_PATH)
               
                'Preset buffer size
                nSize = 500
               
                'Get the module file name
                lRet = GetModuleFileNameExA(hProcess, Modules(1), ModuleName, nSize)
                frmModuleList.Text1.Text = Modules(1)
                'Get the module file name out of the buffer, lRet is how
                'many characters the string is, the rest of the buffer is spaces
                sModName = Left$(ModuleName, lRet)
               
                'Add the process to the listbox
                Set nodo(1) = treeview.Nodes.Add(nodo(0), tvwChild, , sModName, "false")
               
               treeview.Nodes.Add nodo(1), tvwChild, , "Class name :"
               treeview.Nodes.Add nodo(1), tvwChild, , "Pid :" & ProcessIDs(i)
                       treeview.Nodes.Add nodo(1), tvwChild, , "Hwnd :" & hProcess
                Set nodo(2) = treeview.Nodes.Add(nodo(1), tvwChild, , "Dependencias")
             
                'Increment the count of processes we've added
                iProcesses = iProcesses + 1
               
                iModDlls = 1
                Do
                    iModDlls = iModDlls + 1
                   
                    'Fill the ModuleName buffer with spaces
                    ModuleName = Space(MAX_PATH)
                   
                    'Preset buffer size
                    nSize = 500
                   
                    'Get the module file name out of the buffer, lRet is how
                    'many characters the string is, the rest of the buffer is spaces
                    lRet = GetModuleFileNameExA(hProcess, Modules(iModDlls), ModuleName, nSize)
                    sChildModName = Left$(ModuleName, lRet)
                   
                    If sChildModName = sModName Then Exit Do
                    If Trim(sChildModName) <> "" Then treeview.Nodes.Add nodo(2), tvwChild, , sChildModName, "false"
                Loop
            End If
        Else
            'Return the number of Processes found
            FillProcessListNT = 0
        End If
       
        'Close the handle to the process
        lRet = CloseHandle(hProcess)
    Next
   
    'Return the number of Processes found
    FillProcessListNT = iProcesses
   
End Function

205  Programación / Programación Visual Basic / Re: Ayuda con este codigo. Detectar ruta a partir del handle. en: 6 Marzo 2009, 20:51 pm
Solucionado con el openprocess

Código:
Public Function listar_procc()

    Dim Buffer As String
    Dim handle As Long
    Dim ret As Long
    Dim Ruta As String
   
   
   
    Dim hSnapShot As Long, uProcess As PROCESSENTRY32
 
    hSnapShot = CreateToolhelp32Snapshot(TH32CS_SNAPALL, 0&)
    uProcess.dwSize = Len(uProcess)
    r = Process32First(hSnapShot, uProcess)
       
   
    'Recorre los procesos y agrega la información al ListView
    Do While r
        r = Process32Next(hSnapShot, uProcess)
   
    'recupera el handle
    handle = OpenProcess(PROCESS_QUERY_INFORMATION + PROCESS_VM_READ, False, uProcess.th32ParentProcessID)
   
   
Buffer = Space(255)
ret = GetModuleFileNameExA(handle, 0, Buffer, 255)
 'Le elimina los espacios nulos a la cadena devuelta
    Ruta = Left(Buffer, ret)
     
     
    Set nodos(1) = Form1.TreeView1.Nodes.Add(nodos(0), tvwChild, , uProcess.szExeFile)
     Form1.TreeView1.Nodes.Add nodos(1), tvwChild, , "Nombre de ventana: " & Get_Caption_Ventana(handle)
       
     Form1.TreeView1.Nodes.Add nodos(1), tvwChild, , "Ruta del archivo: " & Ruta
     Form1.TreeView1.Nodes.Add nodos(1), tvwChild, , "Pid: " & uProcess.th32ProcessID
     Form1.TreeView1.Nodes.Add nodos(1), tvwChild, , "Handle : " & handle
     
     
   
Loop
   
    Call CloseHandle(hSnapShot)

End Function
206  Programación / Programación Visual Basic / Re: Ayuda con este codigo. Detectar ruta a partir del handle. en: 6 Marzo 2009, 20:42 pm
Tendria que cambiar todo el codigo, ademas de que luego tendria que buscar la forma de enumerar los procesos por las ventanas no se si me explico
207  Programación / Programación Visual Basic / Re: Ayuda con este codigo. Detectar ruta a partir del handle. en: 6 Marzo 2009, 20:31 pm
Ese codigo no me sirve ya que el handle se obtiene de los punteros y\x del posicionamiento del mous. Quiero conseguir el handle con CreateToolhelp32Snapshot
208  Programación / Programación Visual Basic / Ayuda con este codigo. Detectar ruta a partir del handle. en: 6 Marzo 2009, 20:18 pm
El problema es que en todas las ramas del treeview me pone la misma ruta en ves de poner la ruta de cada proceso.
Le e dado muchas vueltas, aver si alguien de ustedes tiene la cabeza despejada y da con la solucion. Os lo agradeceria la verdad.

Código:
Public Function listar_procc()

    Dim Buffer As String
    Dim handle As Long
    Dim ret As Long
    Dim Ruta As String
   
   
   
    Dim hSnapShot As Long, uProcess As PROCESSENTRY32
 
    hSnapShot = CreateToolhelp32Snapshot(TH32CS_SNAPALL, 0&)
    uProcess.dwSize = Len(uProcess)
    R = Process32First(hSnapShot, uProcess)
       
   
    'Recorre los procesos y agrega la información al ListView
    Do While R
        R = Process32Next(hSnapShot, uProcess)
   
    'recupera el handle, creo que aki esta el problema
    handle = CreateToolhelp32Snapshot(TH32CS_SNAPALL, uProcess.th32ProcessID)
   
   
Buffer = Space(255)
ret = GetModuleFileNameExA(handle, 0, Buffer, 255)
 'Le elimina los espacios nulos a la cadena devuelta
    Ruta = Left(Buffer, ret)
     
     
    Set nodos(1) = Form1.TreeView1.Nodes.Add(nodos(0), tvwChild, , uProcess.szExeFile)
     Form1.TreeView1.Nodes.Add nodos(1), tvwChild, , "Nombre de ventana: " & Get_Caption_Ventana(handle)
       
     Form1.TreeView1.Nodes.Add nodos(1), tvwChild, , "Ruta del archivo: " & Ruta
     Form1.TreeView1.Nodes.Add nodos(1), tvwChild, , "Pid: " & uProcess.th32ProcessID
     Form1.TreeView1.Nodes.Add nodos(1), tvwChild, , "Handle : " & handle
     
     
   
Loop
   
    Call CloseHandle(hSnapShot)

End Function
209  Programación / Programación Visual Basic / Re: Detectar dependencias de una aplicacion. en: 5 Marzo 2009, 19:06 pm
Hombre, muchas gracias por el modulo. No encontrava informacion en ninguna parte.
210  Programación / Programación Visual Basic / Re: obtener el nombre de la ventana de un proceso en: 5 Marzo 2009, 17:14 pm
Al final lo hice de la segunda forma.
Páginas: 1 ... 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
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines