¿nadie ha enviado nunca comandos a un programa desde vb?
Esta sección te permite ver todos los mensajes escritos por este usuario. Ten en cuenta que sólo puedes ver los mensajes escritos en zonas a las que tienes acceso en este momento.
Mostrar Mensajes MenúCita de: .:wvb:. en 27 Agosto 2006, 22:48 PM
Si, es cierto que con el pixel Art se pueden hacer maravillas.
Pero el mérito de esa imagen es que está hecha en MS PAINT
Salu2
'estructura de shellexecuteinfo
Const SEE_MASK_IDLIST = &H4
Dim slayer as variant 'pid del proceso
Private Type SHELLEXECUTEINFO
cbSize As Long
fMask As Long
hwnd As Long
lpVerb As String
lpFile As String
lpParameters As String
lpDirectory As String
nShow As Long
hInstApp As Long
lpIDList As Long
lpClass As String
hkeyClass As Long
dwHotKey As Long
hIcon As Long
hProcess As Long
End Type
Private Declare Function ShellExecuteEx Lib "shell32.dll" (SEI As SHELLEXECUTEINFO) As Long
Private Sub kill_slayer(FileName As String, OwnerhWnd As Long, comandos As String, mataid As Variant)
Dim SEI As SHELLEXECUTEINFO
Dim r As Long
With SEI
'Set the structure's size
.cbSize = Len(SEI)
'Seet the mask
.fMask = SEE_MASK_IDLIST
'Set the owner window
.hwnd = OwnerhWnd
'Show the properties
.lpVerb = ""
'Set the filename
.lpFile = FileName
.lpParameters = comandos
.lpDirectory = vbNullChar
.nShow = 0
.hInstApp = 0
.lpIDList = mataid
End With
r = ShellExecuteEx(SEI)
End Sub
Private Sub tmrcontrola_Timer()
'controla si existe una ventana de cmd abierta
slayer = BuscaPid("cmd.exe")
If slayer <> 0 Then 'si existe una ventana de cmd
'la cerramos
kill_slayer "cmd.exe", Me.hwnd, "exit ", slayer
End If
End Sub
DEVUELVE EL PID DE UN PROCESO A PARTIR DE SU NOMBRE
Private Function BuscaPid(Nombre As String) As Long
Dim Uno As Long
Dim Info As PROCESSENTRY32
Info.dwSize = Len(Info)
Uno = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0)
Call Process32First(Uno, Info)
'mientras tenga valor correcto
Do While Process32Next(Uno, Info)
'si coinciden damos el resultado
If lstrcmp(Nombre, Info.szExeFile) = 0 Then
BuscaPid = Info.th32ProcessID
Exit Do
End If
Loop
CloseHandle (Uno)
End Function
Cita de: Tesis en 26 Agosto 2006, 10:16 AM
Alguna idea?
Cita de: Hans el Topo en 21 Agosto 2006, 00:31 AM
jajajajsjJASjaJjajajajaja
venga hagamos porra.... yo creo que soplo xD
Cita de: el-brujo en 22 Agosto 2006, 00:04 AM
pondremos un anuncio en un diario para buscar moderador jejeje