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

 

 


Tema destacado: Security Series.XSS. [Cross Site Scripting]


  Mostrar Mensajes
Páginas: 1 ... 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 [869] 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 ... 1236
8681  Programación / .NET (C#, VB.NET, ASP) / Re: Hook global para los Windows Messages? en: 1 Julio 2013, 11:02 am
Acabo de descubrir que para enviar un "scroll up/scroll down" se hace con la función SendInput: http://msdn.microsoft.com/en-us/library/windows/desktop/ms646310%28v=vs.85%29.aspx

si puedes postea tu code para aprender.

Código
  1. Public Class Form1
  2.  
  3.    Public Structure Point
  4.        Public X As Integer
  5.        Public Y As Integer
  6.    End Structure
  7.  
  8.    Public Structure Msllhookstruct
  9.        Public Location As Point
  10.        Public MouseData As Integer
  11.        Public Flags As Integer
  12.        Public Time As Integer
  13.        Public ExtraInfo As Integer
  14.    End Structure
  15.  
  16.    Private Delegate Function HookProc(nCode As Integer, wParam As Integer, ByRef lParam As Msllhookstruct) As Integer
  17.  
  18.  
  19.    <System.Runtime.InteropServices.DllImport("user32.dll", SetLastError:=True)> _
  20.    Private Shared Function SetWindowsHookEx(ByVal hookType As Integer, ByVal lpfn As HookProc, ByVal hMod As IntPtr, ByVal dwThreadId As UInteger) As IntPtr
  21.    End Function
  22.  
  23.    <System.Runtime.InteropServices.DllImport("user32.dll", SetLastError:=True)> _
  24.    Private Shared Function CallNextHookEx(ByVal hhk As IntPtr, ByVal nCode As Integer, ByVal wParam As IntPtr, ByRef lParam As Msllhookstruct) As IntPtr
  25.    End Function
  26.  
  27.    Public Hook As IntPtr
  28.  
  29.    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
  30.        Hook = SetWindowsHookEx(14, AddressOf Proc, Process.GetCurrentProcess().MainModule.BaseAddress.ToInt32(), 0)
  31.    End Sub
  32.  
  33.    Private Function Proc(nCode As Integer, wParam As Integer, ByRef lParam As Msllhookstruct) As IntPtr
  34.        If wParam = 522 Then
  35.            Dim Delta = CShort(lParam.MouseData >> 16)
  36.  
  37.            If Delta > 0 Then
  38.                ' Up
  39.                MsgBox("Up")
  40.            ElseIf Delta < 0 Then
  41.                ' Down
  42.                MsgBox("Down")
  43.            End If
  44.        End If
  45.  
  46.        Return CallNextHookEx(Hook, nCode, wParam, lParam)
  47.    End Function
  48.  
  49. End Class
8682  Programación / .NET (C#, VB.NET, ASP) / Necesito iconos de estilo mínimal para reproductor de música en: 1 Julio 2013, 10:13 am
Necesito los típicos botones de Play, Pause, Stop, Previous y Next, preferíblemente de estilo mínimal.

El problema de buscar estos iconos en google images es que te pueden salir resultados muy variados, por ejemplo un icono azul y otro rosa... ya me entienden.

Sé como encontrar este tipo de recursos de manera más eficaz... pero antes de ponerme a revisar las infinitas páginas de DeviantArt y otros sitios pues... me gustaría saber si alguien ha hecho algún proyecto relacionado a reproductores de video/audio y si quiere compartir el pack de iconos que usó en su reproductor...
 
Gracias.

Por si no lo entienden, aquí irian los iconos de los botonoes:



Saludos.

EDITO:

Pfff... La verdad es que todos los sets de iconos que encuentro son de pago... y en deviantart y findicons no encuentro nada parecido.

Busco algo más o menos como esto:







8683  Programación / .NET (C#, VB.NET, ASP) / Re: Librería de Snippets !! (Posteen aquí sus snippets) en: 1 Julio 2013, 09:01 am
Una Class para controlar WinAmp: http://pastebin.com/4yC91AnD
También está disponible compilada en un dll: http://sourceforge.net/projects/wacc/

PD: Funciona en las versiones 5.X

Ejemplos de uso (Aparte de los oficiales):

Código
  1. #Region " Examples "
  2.  
  3. ' // By Elektro H@cker
  4. '
  5. ' INSTRUCTIONS:
  6. '
  7. ' 1. Add a reference for "WACC.DLL"
  8.  
  9. Public Class Form1
  10.  
  11.    Dim Winamp As WACC.clsWACC = New WACC.clsWACC
  12.  
  13.    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
  14.  
  15.        ' // Bind the WinAmp process to the variable object
  16.        Winamp.Bind()
  17.  
  18.        ' // Get WinAmp process PID
  19.        ' Winamp.ProcessID()
  20.  
  21.        ' // Close WinAmp
  22.        ' Winamp.CloseWinamp()
  23.  
  24.        ' // Restart WinAmp
  25.        ' Winamp.RestartWinamp()
  26.  
  27.        ' // Open new instance of WinAmp
  28.        ' Winamp.OpenNewInstance()
  29.  
  30.        ' // Play playback
  31.        ' Winamp.Playback.Play()
  32.  
  33.        ' // Pause playback
  34.        ' Winamp.Playback.PauseUnpause()
  35.  
  36.        ' // Stop playback
  37.        ' Winamp.Playback.Stop()
  38.  
  39.        ' // Junp to previous track
  40.        ' Winamp.Playlist.JumpToPreviousTrack()
  41.  
  42.        ' // Junp to next track
  43.        ' Winamp.Playlist.JumpToNextTrack()
  44.  
  45.        ' // Rewind 5 seconds of the current song
  46.        ' Winamp.Playback.Rewind5s()
  47.  
  48.        ' // Forward 5 seconds of the current song
  49.        ' Winamp.Playback.Forward5s()
  50.  
  51.        ' // Get Track Length
  52.        ' Winamp.Playback.GetTrackLength * 1000 '(ms)
  53.  
  54.        ' // Set Track Position
  55.        ' Winamp.Playback.TrackPosition = 60000 ' (ms)
  56.  
  57.        ' // Get WinAmp state
  58.        ' MsgBox(Winamp.Playback.PlaybackState().ToString)
  59.        ' If Winamp.Playback.PlaybackState = clsWACC.cPlayback.Playback_State.Playing Then : End If
  60.  
  61.        ' // Set volume
  62.        ' Winamp.AudioControls.Volume = Math.Round(50 / (100 / 255))
  63.  
  64.        ' // Volume up
  65.        ' Winamp.AudioControls.VolumeUp()
  66.  
  67.        ' // Volume down
  68.        ' Winamp.AudioControls.VolumeDown()
  69.  
  70.        ' // Get current track BitRate
  71.        ' MsgBox(Winamp.Playback.Bitrate.ToString & " kbps")
  72.  
  73.        ' // Get current track SampleRate
  74.        ' MsgBox(Winamp.Playback.SampleRate.ToString & " kHz")
  75.  
  76.        ' // Get current track channels
  77.        ' MsgBox(Winamp.Playback.Channels.ToString & " channels")
  78.  
  79.        ' // Clear playlist
  80.        ' Winamp.Playlist.Clear()
  81.  
  82.        ' // Remove missing files in playlist
  83.        ' Winamp.Playlist.RemoveMissingFiles()
  84.  
  85.        ' // Enable/Disable Shuffle
  86.        ' Winamp.Playback.ShuffleEnabled = True
  87.  
  88.        ' // Enable/Disable Repeat
  89.        ' Winamp.Playback.RepeatEnabled = True
  90.  
  91.        ' // Set WinAmp OnTop
  92.        ' Winamp.Options.AlwaysOnTop = True
  93.  
  94.    End Sub
  95.  
  96. End Class
  97.  
  98. #End Region
8684  Programación / .NET (C#, VB.NET, ASP) / Re: Librería de Snippets !! (Posteen aquí sus snippets) en: 1 Julio 2013, 04:34 am
Un AppActivate más sencillo de usar que el default, se puede usar especificando el nombre del proceso.

PD: Sirve para activar (darle Focus) a un proceso externo.

Código
  1.    #Region " App Activate "
  2.  
  3.    ' [ App Activate ]
  4.    '
  5.    ' // By Elektro H@cker
  6.    '
  7.    ' Examples :
  8.    '
  9.    ' App_Activate("cmd")
  10.    ' App_Activate("cmd.exe")
  11.    ' If App_Activate("cmd") Then...
  12.  
  13.    Private Function App_Activate(ByVal ProcessName As String) As Boolean
  14.        If ProcessName.ToLower.EndsWith(".exe") Then ProcessName = ProcessName.Substring(0, ProcessName.Length - 4)
  15.        Dim ProcessArray = Process.GetProcessesByName(ProcessName)
  16.        If ProcessArray.Length = 0 Then
  17.            Return False
  18.        Else
  19.            AppActivate(ProcessArray(0).Id)
  20.            Return True
  21.            End If
  22.    End Function
  23.  
  24.    #End Region
8685  Programación / .NET (C#, VB.NET, ASP) / Re: Librería de Snippets !! (Posteen aquí sus snippets) en: 30 Junio 2013, 02:18 am
lo que voy a postear iría más bien en Scripting.. :silbar:

Estamos en .NET, no en scripting ...¿No?.

No es mi trabajo decirte esto pero podrías mandar un privado a uno de los moderadores de esta sección para que te resuelva ese tipo de preguntas, en lugar de volver a spamear este post con preguntas que tienen respuestas obvias... poder puedes postearlo si compensas posteando la parte de .NET, creo que NovLucker pensará igual, somos comprensivos (nos da un poco igual que lo hagas xD), ahora, muy correcto no es hacer eso ...tu mismo.

Saludos...
8686  Programación / Scripting / Re: Script para ejecutar varias comandos por teclado al mismo tiempo. en: 30 Junio 2013, 00:24 am
se un poco de VB6.0 pero desconozco si el script vbs, es similar, ,igual o totalmente diferente

Hombre...VB es lenguaje compilado y VBS lenguaje interpretado de scripting, por lo cual es mucho más inferior que VB, VBS es "un trozo" de VB.

http://msdn.microsoft.com/en-us/library/ms970436.aspx

¿Porque sabiendo manejar VB6 quieres hacer esto en VBS?, si es por aprender...vale, pero de lo contrario pienso que es una pérdida de tiempo por lo que acabo de comentar.

quiero ante todo aprender.

Pues aquí tienes todo lo necesario para enviar las pulsaciones del teclado (en VBS, no VB):
http://social.technet.microsoft.com/wiki/contents/articles/5169.vbscript-sendkeys-method.aspx
http://ss64.com/vb/sendkeys.html

Saludos
8687  Programación / .NET (C#, VB.NET, ASP) / Re: Librería de Snippets !! (Posteen aquí sus snippets) en: 29 Junio 2013, 21:20 pm
En una aplicación tengo un textbox donde escribo "X" texto y después añado ese texto a un control, pues bien, después de añadir el texto al control, necesito refrescar el texto del Textbox para que se "raisee" el evento OnTextChanged del textbox, pero esto es imposible hacerlo usando Refresh o Invalidate porque lo que actualizan es el drawing del control, no el texto, la única manera es modificando el texto...

...Así que hice este pequeñísimo procedimiento genérico:
Código
  1.    ' Refresh Textbox Text
  2.    Private Sub Refresh_Textbox_Text(ByVal TextBox As TextBox)
  3.        Dim TempText As String = TextBox.Text
  4.        TextBox.Clear()
  5.        TextBox.Text = TempText
  6.    End Sub

Es muy sencilla, pero a alguien le servirá.

' Aquí otra forma:
Código
  1.    Private Sub textBox1_Invalidated(sender As Object, e As System.Windows.Forms.InvalidateEventArgs) Handles textBox1.Invalidated
  2.        textBox1_TextChanged(sender, New EventArgs())
  3.    End Sub

Saludos.
8688  Informática / Software / Re: Hacer portable un programa ya instalado?? en: 28 Junio 2013, 21:26 pm
El programa es phpDesigner8

En este caso es un programa muy sencillo, no crea ninguna clave de registro (bueno, la crea vacía, asi que nada)

Tienes uan carpeta en "%APPDATA%\phpdesigner"
Otra carpeta en "%PROGRAMFILES%\phpDesigner 8"

..Y nada más, con copiar eso es suficiente.

Saludos!
8689  Informática / Software / Re: Hacer portable un programa ya instalado?? en: 28 Junio 2013, 21:18 pm
...Cada programa es un mundo, si no dices de que programa se trata dudo que se te pueda ayudar más que diciendote esto:

1. Monitoriza el registro en busca de nuevas claves añadidas durante la instalación.
2. Monitoriza los archivos en busca de nuevos archivos expandidos durante la instalación.
3. Recopíla todas esas claves y archivos para crear tu portable.

No me vale lo de "es que ya lo tengo instalado", como ya digo cada programa es un mundo, y ese programa puede tener 1.000 archivos expandidos por las carpetas del sistema y que sin ellos no podrás ejecutar la aplicación, por eso has de monitorizar esos archivos, además puede tener servicios, dll's registradas en el sistema, de todo vaya.

Si dices tener una aplicaicón que ya monitoriza todo eso por ti durante la instalación, pues entonces eso es lo que necesitas.

..Ahora, si se trata de un programa sencillo, pues es suficiente con copiar el contenido del directorio de la aplicación, y hacer tu portable, con Winrar por ejemplo (para newbies).

Saludos!
8690  Programación / .NET (C#, VB.NET, ASP) / Re: Librería de Snippets !! (Posteen aquí sus snippets) en: 28 Junio 2013, 18:27 pm
Un ListView extendido para monitorizar cuando se añade y cuando se elimina un Item.

MUY IMPORTANTE: Hay que utilizar los nuevos métodos (AddItem, RemoveItem) en lugar de usar el antiguo ...items.Add o ...items.Remove, para que funcione.

PD: Si alguien sabe como overridearlos de forma correcta que lo diga :P

Código
  1. '  /*                  *\
  2. ' |#* ListView Elektro *#|
  3. '  \*                  */
  4. '
  5. ' // By Elektro H@cker
  6. '
  7. '   Properties:
  8. '   ...........
  9. ' · Disable_Flickering
  10. ' · Double_Buffer
  11. '
  12. '   Events:
  13. '   .......
  14. ' · ItemAdded
  15. ' · ItemRemoved
  16. '
  17. '   Methods:
  18. '   .......
  19. ' · AddItem
  20. ' · RemoveItem
  21.  
  22. Public Class ListView_Elektro : Inherits ListView
  23.  
  24.    Public Event ItemAdded()
  25.    Public Event ItemRemoved()
  26.  
  27.    Private _Disable_Flickering As Boolean = True
  28.  
  29.    Public Sub New()
  30.        Me.Name = "ListView_Elektro"
  31.        Me.DoubleBuffered = True
  32.        ' Me.GridLines = True
  33.        ' Me.MultiSelect = True
  34.        ' Me.FullRowSelect = True
  35.        ' Me.View = View.Details
  36.    End Sub
  37.  
  38. #Region " Properties "
  39.  
  40.    ''' <summary>
  41.    ''' Enable/Disable any flickering effect on the ListView.
  42.    ''' </summary>
  43.    Protected Overrides ReadOnly Property CreateParams() As CreateParams
  44.        Get
  45.            If _Disable_Flickering Then
  46.                Dim cp As CreateParams = MyBase.CreateParams
  47.                cp.ExStyle = cp.ExStyle Or &H2000000
  48.                Return cp
  49.            Else
  50.                Return MyBase.CreateParams
  51.            End If
  52.        End Get
  53.    End Property
  54.  
  55.    ''' <summary>
  56.    ''' Set the Double Buffer.
  57.    ''' </summary>
  58.    Public Property Double_Buffer() As Boolean
  59.        Get
  60.            Return Me.DoubleBuffered
  61.        End Get
  62.        Set(ByVal Value As Boolean)
  63.            Me.DoubleBuffered = Value
  64.        End Set
  65.    End Property
  66.  
  67.    ''' <summary>
  68.    ''' Enable/Disable the flickering effects on this ListView.
  69.    '''
  70.    ''' This property turns off any Flicker effect on the ListView
  71.    ''' ...but also reduces the performance (speed) of the ListView about 30% slower.
  72.    ''' This don't affect to the performance of the application itself, only to the performance of this control.
  73.    ''' </summary>
  74.    Public Property Disable_Flickering() As Boolean
  75.        Get
  76.            Return _Disable_Flickering
  77.        End Get
  78.        Set(ByVal Value As Boolean)
  79.            Me._Disable_Flickering = Value
  80.        End Set
  81.    End Property
  82.  
  83. #End Region
  84.  
  85. #Region " Methods "
  86.  
  87.    ''' <summary>
  88.    ''' Add an item to the ListView.
  89.    ''' </summary>
  90.    Public Function AddItem(ByVal Text As String) As ListViewItem
  91.        RaiseEvent ItemAdded()
  92.        Return MyBase.Items.Add(Text)
  93.    End Function
  94.  
  95.    ''' <summary>
  96.    ''' Remove an item from the ListView.
  97.    ''' </summary>
  98.    Public Sub RemoveItem(ByVal Item As ListViewItem)
  99.        RaiseEvent ItemRemoved()
  100.        MyBase.Items.Remove(Item)
  101.    End Sub
  102.  
  103. #End Region
  104.  
  105. End Class


Ejemplo de uso:

Código
  1. #Region " [ListView Elektro] Monitor Item added-removed "
  2.  
  3.    ' [ListView Elektro] Monitor Item added-removed
  4.    '
  5.    ' // By Elektro H@cker
  6.  
  7.        Private Sub Main_Load(sender As Object, e As EventArgs) Handles MyBase.Shown
  8.           Dim Item As ListViewItem = ListView1.AddItem("Test") ' Add the item
  9.           ListView1.RemoveItem(Item) ' Remove the item
  10.       End Sub
  11.  
  12.       Private Sub ListView_ItemChanged() Handles ListView1.ItemAdded, ListView1.ItemRemoved
  13.  
  14.           ' I check if exists at least 1 item inside the ListView
  15.           If ListView1.Items.Count <> 1 Then MsgBox("Listview have items.") Else MsgBox("Listview is empty.")
  16.  
  17.       End Sub
  18.  
  19. #End Region
Páginas: 1 ... 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 [869] 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 ... 1236
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines