Source Code Program A. Form Utama Dim IEWin As ciewindows Private Sub Check1_Click() If Check1.Value = GetSetting("Spy", "Settings", "RunAtStartUp", 0) Then Command3.Enabled = False Command3.Enabled = True Private Sub Command1_Click() If Command1.Caption = "Aktif" Then Set IEWin = New ciewindows AddToLog vbcrlf & vbtab & vbtab & vbtab & "Spy Activated " & Now Command1.Caption = "Non Aktif" Label2 = "Status: Aktif" Command2.Caption = "Sembunyikan" Set IEWin = Nothing AddToLog vbtab & vbtab & vbtab & "Spy Deactivated " & Now Command1.Caption = "Aktif" Label2 = "Status: Pasif" Command2.Caption = "Close" Private Sub Command2_Click() If Command2.Caption = "Close" Then Unload Me Me.Hide Private Sub Command3_Click() Dim objwshshell As Object Set objwshshell = CreateObject("WScript.Shell") Command3.Enabled = False Call SaveSetting("InternetSpy", "Settings", "LogFile", Text1.Text) Call SaveSetting("InternetSpy", "Settings", "RunAtStartUp", CStr(Check1.Value)) sfile = Text1 If Check1.Value = 1 Then objwshshell.regwrite "HKLM\Software\Microsoft\Windows\CurrentVersion\Run\InternetSpy ", App.Path & "\" & "InternetSpy.exe" On Error Resume Next objwshshell.regdelete "HKLM\Software\Microsoft\Windows\CurrentVersion\Run\GetSound" On Error GoTo 0
Set objwshshell = Nothing Private Sub Form_Load() App.TaskVisible = False Me.Hide Command3.Caption = "Apply" Command3.Enabled = False Label2 = "Status: Aktif" Command1.Caption = "Non aktif" Command2.Caption = "Sembunyikan" Text1 = GetSetting("InternetSpy", "Settings", "LogFile", "c:\spylog.txt") Check1.Value = GetSetting("InternetSpy", "Settings", "RunAtStartUp", 0) sfile = Text1 Set IEWin = Nothing Set IEWin = New ciewindows AddToLog vbcrlf & vbtab & vbtab & vbtab & "Spy Activated " & Now & vbcrlf SetHotKey hwnd, MOD_CONTROL + MOD_SHIFT, vbkeyp Private Sub Form_Unload(Cancel As Integer) RemoveHotKey Set IEWin = Nothing Private Sub Label1_Click() Private Sub Frame1_DragDrop(Source As Control, X As Single, Y As Single) Private Sub Text1_Change() If Text1 = GetSetting("InternetSpy", "Settings", "LogFile", "c:\spylog.txt") Then Command3.Enabled = False Command3.Enabled = True B. Module Hot Key Private Declare Function RegisterHotKey Lib "user32" (ByVal hwnd As Long, ByVal id As Long, ByVal fsmodifiers As Long, ByVal vk As Long) As Long Private Declare Function GlobalAddAtom Lib "kernel32" Alias "GlobalAddAtomA" (ByVal lpstring As String) As Integer Private Declare Function GlobalDeleteAtom Lib "kernel32" (ByVal natom As Integer) As Integer Private Declare Function UnregisterHotKey Lib "user32" (ByVal hwnd As Long, ByVal id 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 GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nindex As Long) As Long Private Declare Function CallWindowProc Lib "user32" Alias "CallWindowProcA" (ByVal lpprevwndfunc As Long, ByVal hwnd As Long, ByVal Msg As Long, ByVal wparam As Long, ByVal lparam As Long) As Long Const GWL_WNDPROC = (-4) Const WM_HOTKEY = &H312 Public Enum ModKeys MOD_ALT = &H1 MOD_CONTROL = &H2 MOD_SHIFT = &H4 MOD_WIN = &H8 End Enum Dim iatom As Integer Dim OldProc As Long, howner As Long Public sfile As String Public Function SetHotKey(hWin As Long, ModKey As ModKeys, vkey As Long) As Boolean If howner > 0 Then Exit Function howner = hwin iatom = GlobalAddAtom("MyHotKey") SetHotKey = RegisterHotKey(hOwner, iatom, ModKey, vkey) OldProc = SetWindowLong(hOwner, GWL_WNDPROC, AddressOf WndProc) End Function Public Sub RemoveHotKey() If howner = 0 Then Exit Sub Call UnregisterHotKey(hOwner, iatom) Call SetWindowLong(hOwner, GWL_WNDPROC, OldProc) Public Function WndProc(ByVal hwnd As Long, ByVal wmsg As Long, ByVal wparam As Long, ByVal lparam As Long) As Long If wmsg = WM_HOTKEY And wparam = iatom Then Form1.Show WndProc = CallWindowProc(OldProc, hwnd, wmsg, wparam, lparam) End Function Public Sub AddToLog(sText As String) Dim nfile As Integer nfile = FreeFile Open sfile For Append As #nfile Print #nfile, stext Close #nfile C. Class Windows
Private WithEvents winshell As SHDocVw.ShellWindows Private mcol As Collection Dim brefreshing As Boolean, binit As Boolean Private Function Add(IEctl As SHDocVw.InternetExplorer) As IE_Class Dim objnewmember As IE_Class Set objnewmember = New IE_Class Set objnewmember.iectl = IEctl mcol.add objnewmember Set Add = objnewmember Set objnewmember = Nothing End Function Public Property Get IE(vntIndexKey As Variant) As IE_Class Do While brefreshing DoEvents Loop Set IE = mcol(vntindexkey) End Property Public Property Get Count() As Long Count = mcol.count End Property Private Sub Remove(vntIndexKey As Variant) mcol.remove vntindexkey Public Property Get NewEnum() As IUnknown Set NewEnum = mcol.[_newenum] End Property Private Sub Class_Initialize() Refresh_Col Private Sub Class_Terminate() Set mcol = Nothing Set winshell = Nothing Private Sub winshell_windowregistered(byval lcookie As Long) Refresh_Col Do While brefreshing DoEvents Loop Private Sub winshell_windowrevoked(byval lcookie As Long) Refresh_Col Do While brefreshing DoEvents Loop Private Sub Refresh_Col() brefreshing = True Dim SWs As New SHDocVw.ShellWindows
Dim var As SHDocVw.InternetExplorer Set mcol = Nothing Set mcol = New Collection For Each var In SWs Add var Next If Not binit Then Set winshell = SWs binit = True Set SWs = Nothing Set var = Nothing brefreshing = False D. Calss Internet Explorer Private WithEvents IE As SHDocVw.InternetExplorer Private bdownloading As Boolean Public Property Set IEctl(IncomeIE As SHDocVw.InternetExplorer) Set IE = IncomeIE End Property Private Sub Class_Terminate() ' On Error Resume Next Set IE = Nothing Private Sub IE_BeforeNavigate2(ByVal pdisp As Object, URL As Variant, Flags As Variant, TargetFrameName As Variant, PostData As Variant, Headers As Variant, Cancel As Boolean) Dim s As String If Not bdownloading Then s = Time & vbtab & "Navigation begin." s = s & vbcrlf & vbtab & "URL = " & CStr(URL) AddToLog s bdownloading = True Private Sub IE_DocumentComplete(ByVal pdisp As Object, URL As Variant) Dim s As String If pdisp Is IE Then s = Time & vbtab & "Documente complete." s = s & vbcrlf & vbtab & "URL = " & IE.LocationURL Do While IE.Busy DoEvents Loop s = s & vbcrlf & vbtab & "Location = " & IE.LocationName AddToLog s bdownloading = False Private Sub IE_DownloadBegin() Dim s As String If Not bdownloading Then s = Time & vbtab & "Navigation begin." s = s & vbcrlf & vbtab & "URL = " & IE.LocationURL
AddToLog s bdownloading = True
SURAT KETERANGAN Hasil Uji Program Tugas Akhir Yang bertanda tangan dibawah ini, menerangkan bahwa Mahasiswa Tugas Akhir Program Diploma 3 Ilmu Komputer/Statistika : Nama : Muhammad Reza Fauzi NIM : 072406130 Prog. Studi : Ilmu Komputer Judul TA : Program Aplikasi Pencatatan History Dari Web Browser Untuk Memudahkan Orangtua Mengawasi Anak anaknya Ketika Menggunakan Internet Telah melaksanakan test program Tugas Akhir Mahasiswa tersebut di atas pada tanggal. Dengan Hasil : Sukses / Gagal Demikian diterangkan untuk digunakan melengkapi syarat pendaftaran Ujian Meja Hijau Tugas Akhir Mahasiswa bersangkutan di Departemen Matematika FMIPA USU Medan. Medan, Mei 2010 Dosen Pembimbing Drs. Suyanto M.Kom NIP 19590813 198601 1002
KEMENTERIAN PENDIDIKAN NASIONAL UNIVERSITAS SUMATERA UTARA FAKULTAS MATEMATIKA DAN ILMU PENGETAHUAN ALAM(FMIPA) Jl. Bioteknologi No.1 Kampus USU Telp. (061) 8211050 Fax (061) 8214290 MEDAN 20155, Email : Dekanat@FMIPA.USU.AC.ID KARTU BIMBINGAN TUGAS AKHIR MAHASISWA No Nama Mahasiswa : Muhammad Reza Fauzi Nomor Stambuk : 072406130 Judul Tugas Akhir Dosen Pembimbing Tanggal Mulai Bimbingan : Tanggal Selesai Bimbingan : TANGGAL ASISTEN BIMBINGAN PEMBAHASAN PADA ASISTENSI MENGENAI, PADA BAB : Program Aplikasi Pencatatan History Dari Web Browser Untuk Memudahkan Orangtua Mengawasi Anak anaknya Ketika Menggunakan Internet : Drs. Suyanto, M.Kom PARAF DOSEN PEMBIMBING KETERANGAN * Kartu ini harap dikembalikan ke Departemen Matematika bila bimbingan telah selesai. Diketahui: Ketua Departemen Matematika FMIPA USU, Disetujui Pembimbing Utama/ Penanggung Jawab Dr. Saib Suwilo M.Sc Drs. Suyanto, M.Kom NIP. 19640109 198803 1 004 NIP. 19590813 198601 1002