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

 

 


Tema destacado: AIO elhacker.NET 2021 Compilación herramientas análisis y desinfección malware


  Mostrar Mensajes
Páginas: 1 2 3 4 5 [6] 7
51  Programación / Programación Visual Basic / Re: Problemas con un mataprocesos en: 6 Marzo 2006, 16:59 pm
Windows API (Ansi)

Agrega eso como referencia y te olvidas de declarar las APIs.

La función va a devolver el path de tu proceso si el nombre del proceso que le pasaste no se está ejecutando.
52  Programación / Programación Visual Basic / Re: Problemas con un mataprocesos en: 6 Marzo 2006, 15:36 pm
GetModuleFilenameEx no funciona en Win9X, hay una manera mucho más sencilla usando sólo GetModuleFilename.

La manera fácil es obtener el handle del módulo usando sólo el nombre, que es lo que te devuelve Process32First/Next y luego llamar a GetModuleFilename, como en la siguiente función:

Código:
Function GetProcessFilename(ByVal ModuleName As String) As String
      Dim sPath$, lPath&
      Dim hModule&, r&

  lPath = MAX_PATH
  sPath = String$(MAX_PATH, 0)
 
  hModule = GetModuleHandle(ModuleName)
 
  r = GetModuleFileName(hModule, sPath, lPath)
 
  If r Then
    GetProcessFilename = Left$(sPath, r)
  End If
End Function

Y te ahorras mucho código.

Saludos.
53  Programación / Programación Visual Basic / Re: Problemas con un mataprocesos en: 6 Marzo 2006, 15:12 pm
Sí no especifica el path tiene que estar debajo de esa clave, con el siguiente formato:

Código:
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\App Paths\<appname>

Y lees el valor predeterminado, que es la ruta de acceso completa. Si no existe esa clave, entonces el siguiente paso es buscar en la variable de entorno PATH

Código:
Debug.Print Environ("PATH")

Y por último en el directorio de Windows y en el directorio del sistema (GetWindowsDirectory y GetSystemDirectory).
54  Programación / Programación Visual Basic / Re: Problemas con un mataprocesos en: 6 Marzo 2006, 14:26 pm
Código:
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\App Paths
55  Programación / Programación Visual Basic / Re: Encontrar una palabra dentro de un texto en: 6 Marzo 2006, 00:14 am
Código:
  ' Reemplaza Space por HendriX
  '
  sData = Replace$(sData, "Space", "HendriX")

o

Código:
Function ReplaceStr(ByVal Text As String, ByVal Find As String, ByVal NewStr As String) As String
         Dim lPos&

  lPos = InStr(1, Text, Find)

  If lPos Then
    Mid(Text, lPos, Len(Find)) = NewStr
    ReplaceStr = Text
  End If
End Function

En el caso de TextBox

Código:
      Dim lPos&, sFind$

  sFind = "Space"
  lPos = Instr(1, txtData, sFind)

  If lPos Then
    txtData.SelStart = lPos
    txtData.SelLength = Len(sFind)
  End If
56  Programación / Programación Visual Basic / Re: Ayuda como forzar a un textbox para que solo acepte numeros en: 5 Marzo 2006, 01:34 am
Código:
Private Sub txtData_LostFocus()
  If Not IsNumeric(txtData) Then
    Call MsgBox("Tenés que ingresar un valor numérico", vbExclamation)
    txtData = vbNullString
  End If
End Sub

o

Código:
Private Sub txtNum_Validate(Cancel As Boolean)

  If Not IsNumeric(txtData) Then
    Call MsgBox("Tenés que ingresar un valor numérico", vbExclamation)
    txtData = vbNullString
    Cancel = True
  End If
End Sub
57  Programación / Programación Visual Basic / Re: REG_BINARY en: 4 Marzo 2006, 20:03 pm
Código:
    For I = 1 To Len(strData)  Step 2

    Next

Cambia Len(strData) \ 2 por Len(strData)
58  Programación / Programación Visual Basic / Re: Hacer que un text acepte solo numeros en: 4 Marzo 2006, 03:01 am
Código:
Private Sub txtData_LostFocus()
  If Not IsNumeric(txtData) Then
    Call MsgBox("Tenés que ingresar un valor numérico", vbExclamation)
    txtData = vbNullString
  End If
End Sub
59  Programación / Programación Visual Basic / Re: ¿Que es una reindexacion? en: 3 Marzo 2006, 19:18 pm
Está bien, podría llamarse reindexacion.
60  Programación / Programación Visual Basic / Re: Problema con decimales en: 3 Marzo 2006, 19:11 pm
Format$
FormatDateTime$
FormatCurrency$
FormatNumber$
FormatPercent$
Páginas: 1 2 3 4 5 [6] 7
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines