11-04-2009, 01:49 AM
Lol nah, I don't care! here it is:
Form:
Module (for fade effect):
Form:
Code:
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 Const GWL_STYLE = (-16)
Private Const WS_CAPTION = &HC00000
Option Explicit
Dim TLevel As Integer
Private Sub Command1_Click()
Timer1.Enabled = False
Timer2.Enabled = True
End Sub
Private Sub Form_Load()
Timer2.Enabled = False
TLevel = 5
TransForm Me, Val(TLevel)
End Sub
Private Sub picture2_Click(Index As Integer)
End
End Sub
Private Sub Timer1_Timer()
TLevel = TLevel + 5
TransForm Me, Val(TLevel)
If TLevel = 255 Then
Timer1.Enabled = False
End If
End Sub
Private Sub Timer2_Timer()
TLevel = TLevel - 5
TransForm Me, Val(TLevel)
If TLevel = 5 Then
Unload Me
End If
End Sub
Private Sub Command99_Click()
Dim lStyle As Long
lStyle = GetWindowLong(Me.hWnd, GWL_STYLE)
SetWindowLong Me.hWnd, GWL_STYLE, lStyle And Not WS_CAPTION
End Sub
Private Sub Picture1_Click(Index As Integer)
'Shutdown the computer
Shell ("shutdown.exe -s")
'close program
End
End Sub
Module (for fade effect):
Code:
Option Explicit
Private Const GWL_EXSTYLE = (-20)
Private Const WS_EX_LAYERED = &H80000
Private Const LWA_ALPHA = &H2
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" (ByVal hWnd As Long, ByVal crKey As Long, _
ByVal bAlpha As Byte, ByVal dwFlags As Long) As Long
Public Function TransForm(Form As Form, TransLevel As Byte) As Boolean
SetWindowLong Form.hWnd, GWL_EXSTYLE, WS_EX_LAYERED
SetLayeredWindowAttributes Form.hWnd, 0, TransLevel, LWA_ALPHA
TransForm = Err.LastDllError = 0
End Function