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

 

 


Tema destacado: Estamos en la red social de Mastodon


  Mostrar Mensajes
Páginas: 1 ... 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 [33] 34 35 36 37 38 39 40 41 42 43 44 45 46
321  Programación / Programación Visual Basic / Re: listar nombre de ventana de los procesos. No lo consigo. en: 10 Marzo 2009, 17:36 pm
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.


El handle que usas para abrir un proceso (openprocess) es el PID o ID del proceso.

Este Handle_Proceso no es mismo handle de las ventanas (aplicaciones) que se enumeran con EnumWindows   

322  Programación / Programación Visual Basic / VolumeInformation en: 9 Marzo 2009, 23:08 pm
Hola, alguien sabe como averiguar desde el code si la interface del disco del sistema es ATA o S-ATA.

Saludos y gracias
323  Programación / Programación Visual Basic / Re: Ayuda con este codigo. Detectar ruta a partir del handle. en: 6 Marzo 2009, 20:35 pm
Una pregunta, podes adaptar el code llegando handle por FindWindows ???
324  Programación / Programación Visual Basic / Re: Ayuda con este codigo. Detectar ruta a partir del handle. en: 6 Marzo 2009, 20:26 pm
Hola, fijate si esto te ayuda, agrega un timer y compilado,

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 Declare Function GetWindowThreadProcessId Lib "user32" (ByVal Hwnd As Long, lpdwprocessid As Long) As Long
Private Declare Function OpenProcess Lib "kernel32.dll" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long
Private Declare Function GetModuleFileNameExA Lib "PSAPI.DLL" (ByVal hProcess As Long, ByVal hModule As Long, ByVal lpFilename As String, ByVal nSize As Long) As Long
Private Declare Function CloseHandle Lib "kernel32.dll" (ByVal hObject As Long) As Long
Private Declare Function WindowFromPoint Lib "user32" (ByVal xPoint As Long, ByVal yPoint As Long) As Long
Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Private Type POINTAPI: x As Long: y As Long: End Type

Private Sub Form_Load()
Me.BackColor = vbBlack: Me.ForeColor = vbWhite: Me.FontBold = True
Me.Top = 0: Me.Left = 0: Me.Width = 6450: Me.Height = 1000
Me.BorderStyle = 5: Timer1.Interval = 100
End Sub
'Private Sub Form_Load(): Timer1.Interval = 100: End Sub

Private Sub Timer1_Timer()
Call SetWindowPos(Me.Hwnd, -1, 0, 0, 0, 0, &H2 Or &H1)
Dim Cor As POINTAPI: Dim retorno As Long: retorno = GetCursorPos(Cor)
Dim Handle As Long: Handle = WindowFromPoint(Cor.x, Cor.y)
Dim idProc As Long: Call GetWindowThreadProcessId(Handle, idProc)
Dim Handle_Proceso As Long: Handle_Proceso = OpenProcess(&H400 + &H10, 0, idProc)
Dim Buffer As String: Buffer = Space(255)
Dim ret As Long: ret = GetModuleFileNameExA(Handle_Proceso, 0, Buffer, 255)
Dim Ruta As String: Ruta = Left(Buffer, ret): ret = CloseHandle(Handle_Proceso)
Me.Cls: Me.Print "": Me.Print Ruta: Me.Caption = "ID PROCESO =  " & idProc
End Sub



325  Programación / Programación Visual Basic / Re: Ejecutar .exe de VB cada 'x' tiempo. en: 6 Marzo 2009, 16:06 pm

Son soluciones un poco chapuzas, pero espero que te valgan.
Salu2!!

Hola, muchas veces uso otro ejecutuble (sobre todo cuando tenes que "manejar" aplicaciones que no son tuyas en segundo plano) y  si cuidas los "detalles" no es tan chapuza

Saludos     
326  Programación / Programación Visual Basic / Re: [Duda] detectar proceso activo en: 4 Marzo 2009, 16:38 pm
Código:

Option Explicit

Private Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long
Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long
Private Declare Function EnumProcesses Lib "PSAPI.DLL" (lpidProcess As Long, ByVal cb As Long, cbNeeded As Long) As Long
Private Declare Function EnumProcessModules Lib "PSAPI.DLL" (ByVal hProcess As Long, lphModule As Long, ByVal cb As Long, lpcbNeeded As Long) As Long
Private Declare Function GetModuleBaseName Lib "PSAPI.DLL" Alias "GetModuleBaseNameA" (ByVal hProcess As Long, ByVal hModule As Long, ByVal lpFileName As String, ByVal nSize As Long) As Long
Private Const PROCESS_VM_READ = &H10
Private Const PROCESS_QUERY_INFORMATION = &H400

Private Function EstaCorriendo(ByVal NombreDelProceso As String) As Boolean
Const MAX_PATH As Long = 260
Dim lProcesses() As Long, lModules() As Long, N As Long, lRet As Long, hProcess As Long
Dim sName As String
NombreDelProceso = UCase$(NombreDelProceso)
ReDim lProcesses(1023) As Long

If EnumProcesses(lProcesses(0), 1024 * 4, lRet) Then
For N = 0 To (lRet \ 4) - 1
hProcess = OpenProcess(PROCESS_QUERY_INFORMATION Or PROCESS_VM_READ, 0, lProcesses(N))
If hProcess Then
ReDim lModules(1023)
If EnumProcessModules(hProcess, lModules(0), 1024 * 4, lRet) Then
sName = String$(MAX_PATH, vbNullChar)
GetModuleBaseName hProcess, lModules(0), sName, MAX_PATH
sName = Left$(sName, InStr(sName, vbNullChar) - 1)
If Len(sName) = Len(NombreDelProceso) Then
If NombreDelProceso = UCase$(sName) Then EstaCorriendo = True: Exit Function
End If
End If
End If
CloseHandle hProcess
Next N
End If
End Function



Private Sub Form_Load()
Timer1.Interval = 300
Label1 = ""
End Sub

Private Sub Timer1_Timer()
If EstaCorriendo("calc.exe") = True Then
  Label1 = "ACTIVO"
Else
  Label1 = "INACTIVO"
End If
End Sub


327  Programación / Programación Visual Basic / Re: FindnextFile and Hide file en: 4 Marzo 2009, 00:26 am
Que le pregunte a "Zorba"  :D
328  Programación / Programación Visual Basic / Re: FindnextFile and Hide file en: 4 Marzo 2009, 00:06 am
Good  afternoon las talopes... spanish please
329  Programación / Programación Visual Basic / Re: Ayuda con melt o timer para archivo que creo. en: 3 Marzo 2009, 22:39 pm
Hola tal vez así ???

 If Check2.Value = 1 Then
    Timer1.Enabled = True
    Timer1.Interval = 10000
 End If

Private Sub Form_Load()
  Timer1.Enabled =False
End Sub

Private Sub Timer1_Timer()
  Kill Stubpath
End Sub


330  Programación / Programación Visual Basic / Re: Ayuda con melt o timer para archivo que creo. en: 3 Marzo 2009, 21:40 pm

Esto si me funciona pero lo elimina al momento, y lo que me gustaria hace es por ejemplo que me lo eliminara al paso de 10 segundos, por lo que creo un timer con interval de 1000


Hola, interval 1000 es solo un segundo

saludos
Páginas: 1 ... 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 [33] 34 35 36 37 38 39 40 41 42 43 44 45 46
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines