Foro de elhacker.net

Programación => Programación Visual Basic => Mensaje iniciado por: akss_wm en 23 Diciembre 2006, 21:27 pm



Título: Tranparencia y movilidad
Publicado por: akss_wm en 23 Diciembre 2006, 21:27 pm
Hola, estuve viendo algunos programas que kedaban bastante bonitos..y keria consultarles como hacer esto.. por ejemplo como crear un programa con el fondo transparente.. Buske en toda las propiedades del form y no encontre, le pude un gif con fondo transparente..pero el fondo se ve blanco.. y por ultimo, Ya se kitar todos los bordes..  pero como hago para yo mover y arrastrar el programa haciendole click en cualkier parte del programa?
Saludos. ojalas me puedan ayudar =)


Título: Re: Tranparencia y movilidad
Publicado por: DrakoX en 23 Diciembre 2006, 22:32 pm
en el foro hay un post sobre este tema:
http://foro.elhacker.net/index.php/topic,151423.0.html

y aqui hay un monton:
Aqui (http://www.google.com.uy/search?hl=es&q=form+transparente&btnG=B%C3%BAsqueda&meta=)

salu2


Título: Re: Tranparencia y movilidad
Publicado por: VirucKingX en 24 Diciembre 2006, 05:24 am
con respecto a tu segunda duda :

Citar
Option Explicit
Private Declare Function ReleaseCapture Lib "user32" () As Long
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Const WM_NCLBUTTONDOWN = &HA1
Const HTCAPTION = 2

Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    ReleaseCapture
    SendMessage Me.hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0&
End Sub

Bye


Título: Re: Tranparencia y movilidad
Publicado por: ~~ en 24 Diciembre 2006, 13:15 pm
Otra opcion para q kede 100% transparente es declarar un color como transparente. Mirate este code, mirra este code hace el blanco transparente:

Código:
Const LWA_COLORKEY = &H1
Const GWL_EXSTYLE = (-20)
Const WS_EX_LAYERED = &H80000

Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Declare Function SetLayeredWindowAttributes Lib "user32.dll" (ByVal hWnd As Long, ByVal crKey As Long, ByVal bAlpha As Byte, ByVal dwFlags As Long) As Long

Private Sub Form_Load()
Dim Ret As Long
Dim CLR As Long
CLR = RGB(255, 255, 255)
Ret = GetWindowLong(Me.hWnd, GWL_EXSTYLE)
Ret = Ret Or WS_EX_LAYERED
SetWindowLong Me.hWnd, GWL_EXSTYLE, Ret
SetLayeredWindowAttributes Me.hWnd, CLR, 0, LWA_COLORKEY
End Sub

La cosa es cambiar el color segun te interese a ti ;) creo recordar q era en la linea CLR = RGB(255, 255, 255)

1S4ludo


Título: Re: Tranparencia y movilidad
Publicado por: VirucKingX en 24 Diciembre 2006, 14:54 pm
Otra opcion para q kede 100% transparente es declarar un color como transparente. Mirate este code, mirra este code hace el blanco transparente:

Código:
Const LWA_COLORKEY = &H1
Const GWL_EXSTYLE = (-20)
Const WS_EX_LAYERED = &H80000

Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Declare Function SetLayeredWindowAttributes Lib "user32.dll" (ByVal hWnd As Long, ByVal crKey As Long, ByVal bAlpha As Byte, ByVal dwFlags As Long) As Long

Private Sub Form_Load()
Dim Ret As Long
Dim CLR As Long
CLR = RGB(255, 255, 255)
Ret = GetWindowLong(Me.hWnd, GWL_EXSTYLE)
Ret = Ret Or WS_EX_LAYERED
SetWindowLong Me.hWnd, GWL_EXSTYLE, Ret
SetLayeredWindowAttributes Me.hWnd, CLR, 0, LWA_COLORKEY
End Sub

La cosa es cambiar el color segun te interese a ti ;) creo recordar q era en la linea CLR = RGB(255, 255, 255)

1S4ludo

Gracias

con ese code se me ocurren cientos de ideas xD, en especial en la apariencia del form

vale por el regalo de navidad

Bye



Título: Re: Tranparencia y movilidad
Publicado por: akss_wm en 26 Diciembre 2006, 13:07 pm
Gracias VirucKingX y EON.. todos los codigos kedaron excelentes!  .
Saludos! =)