Foro de elhacker.net

Programación => Programación Visual Basic => Mensaje iniciado por: CAR3S? en 14 Enero 2013, 02:26 am



Título: Brillo netbook en vb
Publicado por: CAR3S? en 14 Enero 2013, 02:26 am
Buenas

Estaba pensando en hacer algo para mi netbook ya que no funciona el "Regulador" de brillo.

¿Alguna idea? No encontré nada referido a aumentar/disminuir el brillo en vb...


Título: Re: Brillo netbook en vb
Publicado por: Danyfirex en 14 Enero 2013, 02:56 am
Código
  1. 'Example by Florian Brucker (sirtorf@web.de)
  2. '
  3. 'Paste this code into a form of a new project
  4. 'You better don't close this via the
  5. 'stop-button of the ide but the x-button of
  6. 'the form.
  7. Option Explicit
  8. Private Ramp1(0 To 255, 0 To 2) As Integer
  9. Private Ramp2(0 To 255, 0 To 2) As Integer
  10. Private Declare Function GetDeviceGammaRamp Lib "gdi32" (ByVal hdc As Long, lpv As Any) As Long
  11. Private Declare Function SetDeviceGammaRamp Lib "gdi32" (ByVal hdc As Long, lpv As Any) As Long
  12. Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (Destination As Any, Source As Any, ByVal Length As Long)
  13. Private Sub Form_Load()
  14.   '----------------------------------------------------------------
  15.   Dim iCtr       As Integer
  16.   Dim lVal       As Long
  17.   '----------------------------------------------------------------
  18.   GetDeviceGammaRamp Me.hdc, Ramp1(0, 0)
  19.      For iCtr = 0 To 255
  20.         lVal = Int2Lng(Ramp1(iCtr, 0))
  21.         Ramp2(iCtr, 0) = Lng2Int(Int2Lng(Ramp1(iCtr, 0)) / 2)
  22.         'Die folgenden Zeilen für ROT auskommentieren:
  23.         Ramp2(iCtr, 1) = Lng2Int(Int2Lng(Ramp1(iCtr, 1)) / 2)
  24.         Ramp2(iCtr, 2) = Lng2Int(Int2Lng(Ramp1(iCtr, 2)) / 2)
  25.      Next iCtr
  26.   SetDeviceGammaRamp Me.hdc, Ramp2(0, 0)
  27.   '----------------------------------------------------------------
  28. End Sub
  29. Private Sub Form_Unload(Cancel As Integer)
  30.   '----------------------------------------------------------------
  31.   SetDeviceGammaRamp Me.hdc, Ramp1(0, 0)
  32.   '----------------------------------------------------------------
  33. End Sub
  34. Public Function Int2Lng(IntVal As Integer) As Long
  35.   '----------------------------------------------------------------
  36.   CopyMemory Int2Lng, IntVal, 2
  37.   '----------------------------------------------------------------
  38. End Function
  39. Public Function Lng2Int(Value As Long) As Integer
  40.   '----------------------------------------------------------------
  41.   CopyMemory Lng2Int, Value, 2
  42.   '----------------------------------------------------------------
  43. End Function
  44.  


saludos


Título: Re: Brillo netbook en vb
Publicado por: CAR3S? en 14 Enero 2013, 05:39 am
Hombre, y como podría oscurecerlo más? Por alguna razón no me deja, es decir, quizá lo este haciendo mal lo cual es seguro, pero siempre queda igual de oscuro...