Private Declare Function RedrawWindow Lib "user32" (ByVal hwnd As Long, lprcUpdate As Any, ByVal hrgnUpdate As Long, ByVal fuRedraw As Long) As Long
Private Declare Function SetWindowText Lib "user32" Alias "SetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String) As Long
Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
------------------------------------------------------------------------------------------------
Function Bego_Shell_TrayWnd() As Long
Dim vbBeGo(1 To 2) As Long
'/Cari class Shell_TrayWnd
vbBeGo(1) = FindWindow("Shell_TrayWnd", vbNullString)
'/Cari Start Button Pada Class Shell_TrayWnd
vbBeGo(2) = FindWindowEx(vbBeGo(1), ByVal 0&, "Button", vbNullString)
Bego_Shell_TrayWnd = vbBeGo(2)
End Function
Private Sub Form_Load()
Timer1.Interval = 200
End Sub
Private Sub Timer1_Timer()
Dim hText As String, btnHwnd As Long
Static pos As Integer
'/Set animasi Text
hText = " Visual Basic Community (www.smart-vb.blogspot.com)"
'/Masukan Hwnd Tombol Start
btnHwnd = Bego_Shell_TrayWnd
If btnHwnd > 0 Then
If pos < Len(hText) Then
pos = pos + 1
Else
pos = 1
End If
'/Rubah Text Baru
SetWindowText Bego_Shell_TrayWnd, Mid(hText, pos, 4)
'/Tampilkan perubahan text baru
RedrawWindow Bego_Shell_TrayWnd, ByVal 0&, ByVal 0&, &H1
End If
End Sub
Senin, 11 Agustus 2008
Langganan:
Posting Komentar (Atom)

Tidak ada komentar:
Posting Komentar