History eraser Visual basic source code
Delete history using this code :
‘—Visual basic source Code start—
Option Explicit
Private Type guid
w1 As Long
w2 As Integer
w3 As Integer
w4(7) As Byte
End Type
‘ clsid: (shlguid.h) => SHDOCVW.DLL
Private Const clsid_CUrlHistory = “{3C374A40-BAE4-11CF-BF7D-00AA006946EE}”
‘ clsid: (urlhist.h) => IUrlHistoryStg2
Private Const clsid_IUrlHistoryStg2 = “{AFA0DC11-C313-11D0-831A-00C04FD5AE38}”
‘ vtbl: (urlhist.h) => IUnknown-Release()
Private Const IUrlHistoryStg2_Release As Long = 8&
‘ vtbl: (urlhist.h) => HRESULT=ClearHistory()
Private Const IUrlHistoryStg2_ClearHistory As Long = 36&
‘ const: (WTYPES.h) => ClassContext
Private Const CLSCTX_INPROC_SERVER As Long = 1&
‘ const: (WINERROR.h)
Private Const S_OK As Long = 0&
‘ const: (OAIDL.h) => CallConvention
Private Const CC_STDCALL As Long = 4&
Private Declare Function CLSIDFromString Lib “ole32″ ( _
ByVal lpszProgID As Long, ByRef pCLSID As guid) As Long
Private Declare Function CoCreateInstance Lib “ole32″ ( _
ByRef rclsid As guid, ByVal pUnkOuter As Long, _
ByVal dwClsContext As Long, ByRef riid As guid, _
ByRef ppv As Long) As Long
Private Declare Sub DispCallFunc Lib “oleaut32″ ( _
ByVal ppv As Long, ByVal oVft As Long, _
ByVal cc As Long, ByVal rtTYP As VbVarType, _
ByVal paCNT As Long, ByRef paTypes As Long, _
ByRef paValues As Long, ByRef fuReturn As Variant)
‘ historyDelete Delete IE URL-history
‘ CALL: historyDelete()
‘ IN: —
‘ OUT: log success
Public Function historyDelete() As Boolean
Dim ipt As Long ‘ interface-ptr
Dim ret As Variant
Dim oid As guid
Dim iid As guid
CLSIDFromString StrPtr(clsid_CUrlHistory), oid
CLSIDFromString StrPtr(clsid_IUrlHistoryStg2), iid
If CoCreateInstance(oid, 0, CLSCTX_INPROC_SERVER, iid, _
ipt) = S_OK Then
DispCallFunc ipt, IUrlHistoryStg2_ClearHistory, _
CC_STDCALL, vbLong, 0, 0&, 0&, ret
DispCallFunc ipt, IUrlHistoryStg2_Release, _
CC_STDCALL, vbLong, 0, 0&, 0&, ret
historyDelete = True
End If
End Function
Private Sub Command1_Click()
historyDelete
End Sub.
‘—Visual basic source Code end—
This is part of a Security and privacy application to protect yourself.You can use Visual basic version 5.0 or 6.0 for this code.
Please feel free to checkout the advanced History eraser version at http://www.jvwinc.com/eraser.html.
The entire source code for the History eraser and popup blocker available at http://jvwinc.com/eraser.html is on Jvw reseller page at http://resell.jvw.name.
Tag : Vb , Software , Security.
Related posts