Start Button Kedip
Kode berikut ini digunakan untuk membuat Start Button di Taskbar bisa berkedip.
Buat sebuah Project baru dengan sebuah Form didalamnya. Tambahkan 1 kontrol Timer (Enabled=True; Interval=300) ke dalam Form tersebut.
[ VB 6.0 ]
Di bagian '(Declarations)' dari Form ketikkan :
Private Declare Function FindWindow Lib "user32.dll" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function FindWindowEx Lib "user32.dll" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
Private Declare Function ShowWindow Lib "user32.dll" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
Dim b As Boolean
Di bagian 'Form_Load' ketikkan :Private Declare Function FindWindowEx Lib "user32.dll" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
Private Declare Function ShowWindow Lib "user32.dll" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
Dim b As Boolean
App.TaskVisible = False
Me.Hide
Lalu di bagian 'Timer1_Timer' ketikkan :Me.Hide
ShowWindow FindWindowEx(FindWindow("Shell_TrayWnd", vbNullString), 0, "Button", vbNullString), Abs(CInt(b))
b = Not b
b = Not b
[ VB .NET ]
Di bagian '(Declarations)' dari Form ketikkan :
Private Declare Function FindWindow Lib "user32.dll" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Integer
Private Declare Function FindWindowEx Lib "user32.dll" Alias "FindWindowExA" (ByVal hWnd1 As Integer, ByVal hWnd2 As Integer, ByVal lpsz1 As String, ByVal lpsz2 As String) As Integer
Private Declare Function ShowWindow Lib "user32.dll" (ByVal hwnd As Integer, ByVal nCmdShow As Integer) As Integer
Dim b As Boolean
Di bagian 'Form1_Shown' ketikkan :Private Declare Function FindWindowEx Lib "user32.dll" Alias "FindWindowExA" (ByVal hWnd1 As Integer, ByVal hWnd2 As Integer, ByVal lpsz1 As String, ByVal lpsz2 As String) As Integer
Private Declare Function ShowWindow Lib "user32.dll" (ByVal hwnd As Integer, ByVal nCmdShow As Integer) As Integer
Dim b As Boolean
Me.Hide()
Lalu di bagian 'Timer1_Tick' ketikkan :
ShowWindow(FindWindowEx(FindWindow("Shell_TrayWnd", vbNullString), 0, "Button", vbNullString), System.Math.Abs(CInt(b)))
b = Not b
b = Not b
0 Komentar:
Posting Komentar
Pengunjung yang baik selalu meninggalkan jejak berupa komentar. :)
Berlangganan Posting Komentar [Atom]
<< Beranda