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


Tema destacado: Usando Git para manipular el directorio de trabajo, el índice y commits (segunda parte)


  Mostrar Mensajes
Páginas: 1 ... 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 [886] 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 ... 1254
8851  Sistemas Operativos / Windows / Re: ¿Alguien que tenga algún Windows que no sea el 7 podría hacerme un favor? en: 2 Julio 2013, 15:19 pm
Ingeniería Social?...

Dudo que alguien con 800 mensajes sea así de lammer, para acabar baneado por una tontería, de todas formas yo lo he probado en un win8 virtual por si las moscas  >:D

@OmarHack
En windows 8 x64 se instala, el lynx funciona, los comandos del beta mastershell no lo se, porque no los he encontrado.

PD: si pones "cmd" en el mastershell se ejecuta la cmd y finaliza el mastershell, quizás quieras evitarlo.

saludos
8852  Programación / .NET (C#, VB.NET, ASP) / Re: Librería de Snippets !! (Posteen aquí sus snippets) en: 2 Julio 2013, 07:27 am
He extendido y mejorado la función para buscar texto en la colección de Items de un listview:

PD: la versión antigua la pueden encontrar aquí: http://foro.elhacker.net/net/libreria_de_snippets_posteen_aqui_sus_snippets-t378770.0.html;msg1865639#msg1865639

#Region " [ListView] Find ListView Text "

    ' [ListView] Find ListView Text Function
    '
    ' // By Elektro H@cker
    '
    ' Examples :
    ' MsgBox(Find_ListView_Text(ListView1, "Test"))
    ' MsgBox(Find_ListView_Text(ListView1, "Test", 2, True, True))
    ' If Find_ListView_Text(ListView1, "Test") Then...

    Private Function Find_ListView_Text(ByVal ListView As ListView, _
                                        ByVal SearchString As String, _
                                        Optional ByVal ColumnIndex As Int32 = Nothing, _
                                        Optional ByVal MatchFullText As Boolean = True, _
                                        Optional ByVal IgnoreCase As Boolean = True) As Boolean

        Dim ListViewColumnIndex As Int32 = ListView.Columns.Count - 1

        Select Case ColumnIndex

            Case Is < 0, Is > ListViewColumnIndex ' ColumnIndex is out of range

                Throw New Exception("ColumnIndex is out of range. " & vbNewLine & _
                                    "ColumnIndex Argument: " & ColumnIndex & vbNewLine & _
                                    "ColumnIndex ListView: " & ListViewColumnIndex)

            Case Nothing ' ColumnIndex is nothing

                If MatchFullText AndAlso IgnoreCase Then ' Match full text, All columns, IgnoreCase
                    For Each Item As ListViewItem In ListView.Items
                        For X As Int32 = 0 To ListViewColumnIndex
                            If Item.SubItems(X).Text.ToLower = SearchString.ToLower Then Return True
                        Next
                    Next
                ElseIf MatchFullText AndAlso Not IgnoreCase Then ' Match full text, All columns, CaseSensitive
                    For Each Item As ListViewItem In ListView.Items
                        For X As Int32 = 0 To ListViewColumnIndex
                            If Item.SubItems(X).Text = SearchString Then Return True
                        Next
                    Next
                ElseIf Not MatchFullText AndAlso IgnoreCase Then ' Match part of text, All columns, IgnoreCase
                    If ListView1.FindItemWithText(SearchString) IsNot Nothing Then _
                         Return True _
                    Else Return False
                ElseIf Not MatchFullText AndAlso Not IgnoreCase Then ' Match part of text, All columns, CaseSensitive
                    For Each Item As ListViewItem In ListView.Items
                        For X As Int32 = 0 To ListViewColumnIndex
                            If Item.SubItems(X).Text.Contains(SearchString) Then Return True
                        Next
                    Next
                End If

            Case Else ' ColumnIndex is other else

                If MatchFullText AndAlso IgnoreCase Then ' Match full text, ColumnIndex, IgnoreCase
                    For Each Item As ListViewItem In ListView.Items
                        If Item.SubItems(ColumnIndex).Text.ToLower = SearchString.ToLower Then Return True
                    Next
                ElseIf MatchFullText AndAlso Not IgnoreCase Then  ' Match full text, ColumnIndex, CaseSensitive
                    For Each Item As ListViewItem In ListView.Items
                        If Item.SubItems(ColumnIndex).Text = SearchString Then Return True
                    Next
                ElseIf Not MatchFullText AndAlso IgnoreCase Then ' Match part of text, ColumnIndex, IgnoreCase
                    For Each Item As ListViewItem In ListView.Items
                        If Item.SubItems(ColumnIndex).Text.ToLower.Contains(SearchString.ToLower) Then Return True
                    Next
                ElseIf Not MatchFullText AndAlso Not IgnoreCase Then ' Match part of text, ColumnIndex, CaseSensitive
                    For Each Item As ListViewItem In ListView.Items
                        If Item.SubItems(ColumnIndex).Text.Contains(SearchString) Then Return True
                    Next
                End If

        End Select

        Return False

    End Function

#End Region



EDITO:

Vuelto a mejorar:

(El anterior no medía la cantidad de subitems de cada item, por ejemplo en un listview con 3 columnas, un item con dos subitems y otro item con 3 subitems entonces daba error porque el primer item no tenia un tercer subitem)

Código
  1. #Region " [ListView] Find ListView Text "
  2.  
  3.    ' [ListView] Find ListView Text Function
  4.    '
  5.    ' // By Elektro H@cker
  6.    '
  7.    ' Examples :
  8.    ' MsgBox(Find_ListView_Text(ListView1, "Test"))
  9.    ' MsgBox(Find_ListView_Text(ListView1, "Test", 2, True, True))
  10.    ' If Find_ListView_Text(ListView1, "Test") Then...
  11.  
  12.    Private Function Find_ListView_Text(ByVal ListView As ListView, _
  13.                                        ByVal SearchString As String, _
  14.                                        Optional ByVal ColumnIndex As Int32 = Nothing, _
  15.                                        Optional ByVal MatchFullText As Boolean = True, _
  16.                                        Optional ByVal IgnoreCase As Boolean = True) As Boolean
  17.  
  18.        Select Case ColumnIndex
  19.  
  20.            Case Is < 0, Is > ListView.Columns.Count - 1 ' ColumnIndex is out of range
  21.  
  22.                Throw New Exception("ColumnIndex is out of range. " & vbNewLine & _
  23.                                    "ColumnIndex Argument: " & ColumnIndex & vbNewLine & _
  24.                                    "ColumnIndex ListView: " & ListView.Columns.Count - 1)
  25.  
  26.            Case Nothing ' ColumnIndex is nothing
  27.  
  28.                If MatchFullText Then ' Match full text in all columns
  29.  
  30.                    For Each Item As ListViewItem In ListView.Items
  31.                        For X As Int32 = 0 To Item.SubItems.Count - 1
  32.                            If String.Compare(Item.SubItems(X).Text, SearchString, IgnoreCase) = 0 Then
  33.                                Return True
  34.                            End If
  35.                        Next
  36.                    Next
  37.  
  38.                ElseIf Not MatchFullText Then ' Match part of text in all columns
  39.  
  40.                    Select Case IgnoreCase
  41.                        Case True ' IgnoreCase
  42.                            If ListView1.FindItemWithText(SearchString) IsNot Nothing Then
  43.                                Return True
  44.                            End If
  45.                        Case False ' CaseSensitive
  46.                            For Each Item As ListViewItem In ListView.Items
  47.                                For X As Int32 = 0 To Item.SubItems.Count - 1
  48.                                    If Item.SubItems(X).Text.Contains(SearchString) Then Return True
  49.                                Next
  50.                            Next
  51.                    End Select
  52.  
  53.                End If
  54.  
  55.            Case Else ' ColumnIndex is other else
  56.  
  57.                If MatchFullText Then ' Match full text in ColumnIndex
  58.  
  59.                    For Each Item As ListViewItem In ListView.Items
  60.                        If String.Compare(Item.SubItems(ColumnIndex).Text, SearchString, IgnoreCase) = 0 Then
  61.                            Return True
  62.                        End If
  63.                    Next
  64.  
  65.                ElseIf Not MatchFullText Then ' Match part of text in ColumnIndex
  66.  
  67.                    For Each Item As ListViewItem In ListView.Items
  68.                        Select Case IgnoreCase
  69.                            Case True ' IgnoreCase
  70.                                If Item.SubItems(ColumnIndex).Text.ToLower.Contains(SearchString.ToLower) Then
  71.                                    Return True
  72.                                End If
  73.                            Case False ' CaseSensitive
  74.                                If Item.SubItems(ColumnIndex).Text.Contains(SearchString) Then
  75.                                    Return True
  76.                                End If
  77.                        End Select
  78.                    Next
  79.  
  80.                End If
  81.  
  82.        End Select
  83.  
  84.        Return False ' Any matches
  85.  
  86.    End Function
  87.  
  88. #End Region
8853  Programación / .NET (C#, VB.NET, ASP) / Re: Necesito iconos de estilo mínimal para reproductor de música en: 1 Julio 2013, 20:13 pm
Asi que lo pongo por medio de un "PictureBox" Pero ese no es el chiste :/
No entendí eso, ¿Cual es el problema?

Un textbox es un textbox, no es un control para mostrar imágenes, quiero decir que no te preocupes, la forma de hacerlo es como lo estás haciendo, usando un picturebox. o creando un usercontrol de un TextBox para poner tu imagen xD, pero eso mejor no lo intentes (todavía) es dificil.

EDITO: Bueno, o puedes dibujar un gráfico usando GDI

Saludos
8854  Programación / .NET (C#, VB.NET, ASP) / Re: Necesito iconos de estilo mínimal para reproductor de música en: 1 Julio 2013, 19:54 pm
Ya no lo necesito, pero gracias!

Ninguno de lo que me has mostrado me convence, creo que seguiré usando los de WinAmp, se adaptan bien a los cambios:


Saludos
8855  Programación / .NET (C#, VB.NET, ASP) / Re: Necesito iconos de estilo mínimal para reproductor de música en: 1 Julio 2013, 12:10 pm
...Al final he extraido los iconos del exe del reproductor WinAmp, y no están muy mal:



Aunque no me gustan mucho, sigo esperando a ver si alguien se anima a compartir...

Saludos.
8856  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
8857  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:







8858  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
8859  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
8860  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...
Páginas: 1 ... 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 [886] 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 ... 1254
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines