Test Foro de elhacker.net SMF 2.1

Programación => .NET (C#, VB.NET, ASP) => Programación General => Programación Visual Basic => Mensaje iniciado por: BlackZeroX en 14 Enero 2010, 01:44 AM

Título: * [Source] ShellExecute sin declaracion api
Publicado por: BlackZeroX en 14 Enero 2010, 01:44 AM
.
por que no esta demas poner esto:

Código (vb) [Seleccionar]


'
' ////////////////////////////////////////////////////////////////
' // Autor: BlackZeroX ( Ortega Avila Miguel Angel )            //
' //                                                            //
' // Web: http://InfrAngeluX.Sytes.Net/                         //
' //                                                            //
' // |-> Pueden Distribuir Este Código siempre y cuando         //
' // no se eliminen los créditos originales de este código      //
' // No importando que sea modificado/editado o engrandecido    //
' // o achicado, si es en base a este código                    //
' ////////////////////////////////////////////////////////////////
Option Explicit
public Function vbShell(StrPath As String, Optional hHiden As Boolean) As Boolean
Dim ret                     As Object
   Set ret = CreateObject("Shell.Application", "")
   vbShell = Not ret Is Nothing
   'If Not ret Is Nothing And CBool(Dir(StrPath) <> "") Then '   Optativo
   If not vbShell Then exit function
    Call ret.ShellExecute(StrPath, "", "", "open", Abs(Not hHiden))
End Function



Dulces Lunas!¡.
Título: Re: * [Source] ShellExecute sin declaracion api
Publicado por: Karcrack en 14 Enero 2010, 11:08 AM
Lo he rehecho a mi gusto:
Código (vb) [Seleccionar]
Public Function oShellExecute(ByVal sPath As String, ByVal wShow As VbAppWinStyle) As Boolean
   On Error GoTo F
   
   Call CreateObject("Shell.Application").ShellExecute(sPath, "", "", "", wShow)
   
   oShellExecute = True
   Exit Function
F:  oShellExecute = False
End Function


Interesante funcion, este ShellExecute es util para hacer drive-by-download >:D

Saludos :D