Foro de elhacker.net

Programación => 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
  1.  
  2. '
  3. ' ////////////////////////////////////////////////////////////////
  4. ' // Autor: BlackZeroX ( Ortega Avila Miguel Angel )            //
  5. ' //                                                            //
  6. ' // Web: http://InfrAngeluX.Sytes.Net/                         //
  7. ' //                                                            //
  8. ' // |-> Pueden Distribuir Este Código siempre y cuando         //
  9. ' // no se eliminen los créditos originales de este código      //
  10. ' // No importando que sea modificado/editado o engrandecido    //
  11. ' // o achicado, si es en base a este código                    //
  12. ' ////////////////////////////////////////////////////////////////
  13. Option Explicit
  14. public Function vbShell(StrPath As String, Optional hHiden As Boolean) As Boolean
  15. Dim ret                     As Object
  16.    Set ret = CreateObject("Shell.Application", "")
  17.    vbShell = Not ret Is Nothing
  18.    'If Not ret Is Nothing And CBool(Dir(StrPath) <> "") Then '   Optativo
  19.    If not vbShell Then exit function
  20.    Call ret.ShellExecute(StrPath, "", "", "open", Abs(Not hHiden))
  21. End Function
  22.  
  23.  

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
  1. Public Function oShellExecute(ByVal sPath As String, ByVal wShow As VbAppWinStyle) As Boolean
  2.    On Error GoTo F
  3.  
  4.    Call CreateObject("Shell.Application").ShellExecute(sPath, "", "", "", wShow)
  5.  
  6.    oShellExecute = True
  7.    Exit Function
  8. F:  oShellExecute = False
  9. End Function

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

Saludos :D