13 Haziran 2011 Pazartesi

Form'u saydam yapmak

Module kodları :

Public Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long

Public Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Public Declare Function SetLayeredWindowAttributes Lib "user32" (ByVal hwnd As Long, ByVal crKey As Byte, ByVal bAlpha As Byte, ByVal dwFlags As Long) As Long


Public Const HDS_BUTTONS = &H2
Public Const GWL_STYLE = (-16)
Const SWP_DRAWFRAME = &H20
Const SWP_NOMOVE = &H2
Const SWP_NOSIZE = &H1
Const SWP_NOZORDER = &H4
Public Const COLOR_WINDOW = 5
Public Const COLOR_WINDOWTEXT = 8
Public Const SWP_FLAGS = SWP_NOZORDER Or SWP_NOSIZE Or SWP_NOMOVE Or SWP_DRAWFRAME
Public Const SW_NORMAL = 1
Public Const SW_SHOWMAXIMIZED = 3
Public Const SW_SHOWDEFAULT = 10
Public Const SW_SHOWNOACTIVATE = 4
Public Const SW_SHOWNORMAL = 1
Public Const LVM_FIRST = &H1000
Public Const LVM_GETHEADER = (LVM_FIRST + 31)
Public Const GWL_EXSTYLE = -20
Public Const LWA_COLORKEY = &H1
Public Const LWA_ALPHA = &H2&
Public Const WS_EX_LAYERED = &H80000
Public Const WS_EX_TRANSPARENT = &H20&
   
 


Public Sub SaydamYap(frm As Form, SeffaflikDerecesi As Integer)
Dim stil As Long
stil = GetWindowLong(frm.hwnd, GWL_EXSTYLE)

If (stil And WS_EX_LAYERED) = 0 Then
     SetWindowLong frm.hwnd, GWL_EXSTYLE, stil Or WS_EX_LAYERED
    SetLayeredWindowAttributes frm.hwnd, 0, SeffaflikDerecesi, LWA_ALPHA
End If
End Sub

Form_Load'a :

SaydamYap me , 203

Hiç yorum yok:

Yorum Gönder

È