Visualizza messaggio singolo
Vecchio 24-09-2005, 20.04.14   #1
Longhorn
Senior Member
 
Registrato: 27-02-2005
Messaggi: 202
Longhorn promette bene
[VB6] Codice per le finestre transparenti

Mi spiegate un pò cosa volgiono dire queste righe per fare le trasparenze. Un pò l'ho capito, ma come fabbio ha rendere più o meno transparente , etc...
Option Explicit

Private Const GWL_EXSTYLE = -20
Private Const LWA_COLORKEY = 3
Private Const LWA_ALPHA = 2
Private Const WS_EX_LAYERED = &H80000

Private tpVal As Integer

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 GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetLayeredWindowAttributes Lib "user32" (ByVal hWnd As Long, ByVal cKey As Long, ByVal bAlpha As Long, ByVal dwFlags As Long) As Long
Sub Trasp(hWnd As Long, tVal As Integer)

Call SetWindowLong(hWnd, GWL_EXSTYLE, GetWindowLong(hWnd, GWL_EXSTYLE) Or WS_EX_LAYERED)
Call SetLayeredWindowAttributes(hWnd, 0, (255 * tVal) / 100, LWA_ALPHA)

End Sub
Longhorn non è collegato   Rispondi citando