1. Bukalah VB6 anda.
2. Tambahkan Modul1 dan copy code berikut ini:
Private Declare Function SetLayeredWindowAttributes Lib "user32" _
(ByVal hwnd As Long, ByVal crKey As Long, ByVal bAlpha As Byte, _
ByVal dwFlags As Long) As Long
Private Declare Function UpdateLayeredWindow Lib "user32" _
(ByVal hwnd As Long, ByVal hDCDst As Long, pptDst As Any, _
psize As Any, ByVal hDCSrc As Long, pptSrc As Any, crKey As Long, _
ByVal pblend As Long, ByVal dwFlags 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 SetWindowLong Lib "user32" Alias _
"SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, _
ByVal dwNewLong As Long) As Long
Private Const GWL_EXSTYLE = (-20)
Private Const LWA_COLORKEY = &H1
Private Const LWA_ALPHA = &H2
Private Const ULW_COLORKEY = &H1
Private Const ULW_ALPHA = &H2
Private Const ULW_OPAQUE = &H4
Private Const WS_EX_LAYERED = &H80000
Public Function MakeTransparent(ByVal hwnd As Long, Perc As Integer) As Long
Dim Msg As Long
On Error Resume Next
If Perc < 0 Or Perc > 255 Then
MakeTransparent = 1
Else
Msg = GetWindowLong(hwnd, GWL_EXSTYLE)
Msg = Msg Or WS_EX_LAYERED
SetWindowLong hwnd, GWL_EXSTYLE, Msg
SetLayeredWindowAttributes hwnd, 0, Perc, LWA_ALPHA
MakeTransparent = 0
End If
If Err Then
MakeTransparent = 2
End If
End Function
3. Bukalah form1 dan tambahkan timer1 enable=true dan interval=1
4. Tambahkan timer2 pada form dengan enable=false dan interval=1
5. Lalu copykan coding berikut ini pada form anda:
Option Explicit
Dim jumlah As Integer
Private Sub Form_Load()
MakeTransparent Me.hwnd, 0
jumlah = 0
End Sub
Private Sub Timer1_Timer()
jumlah = jumlah + 5
If jumlah <= 600 Then
MakeTransparent Me.hwnd, jumlah
Else
MakeTransparent Me.hwnd, 255
Timer1.Enabled = False
Timer2.Enabled = True
End If
End Sub
Private Sub Timer2_Timer()
jumlah = jumlah - 5
If jumlah > 5 Then
MakeTransparent Me.hwnd, jumlah
Else
Timer1.Enabled = False
Timer2.Enabled = False
Unload Me
'frmLogin.Show 'jika anda ingin menambahkan form login setelah selesai.
End If
End Sub
Mas maaf, VB6 itu apa ya?
ReplyDeletemas InjectApp.dll nya ada virusnya bisa minta yang baru mas
ReplyDeleteemail saya sandi_rustandi@yahoo.co.id