'This data is stored in a binary format, so we have to read the binary data into
'a byte array and build it into strings.
'As with all of my submissions, I have utilized code found on PSC and elsewhere
'for various functions, but the rest was written by me.
'Special thanks to Kegham, whose Winstartup 2004 project had some valuable code
'for enumerating and walking through registry keys and for some treeview pointers
'and to MrBoBo who also had some very useful code for the registry
'also to David Sykes for his XP style module that i have implemented in all
'of my projects for that XP Look
'once the key values are loaded into the list, pressing delete will delete the selected
'entry from the registry.
'
'Disclaimer:
'THIS PROGRAM ACCESSES AND MODIFIES ENTRIES IN THE REGISTRY!
'I tested it only on my machine, which is windows XP service pack 2
'I am not responsible for any bad things that may happen due to the
'use of this program
'
'As with all software using the registry
'BACKUP your registry before using
'This ran fine on my machine and the only thing it deletes are the
'binary entries for the recent doc list
'
Option Explicit
' This API function allows us to change the parent of any component that has a hWnd
Private Declare Function SetParent Lib "user32" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long
'usage SetParent Check1.hwnd, Command1.hwnd
Dim MaxFiles
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
'Declare the API function call.
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Private Declare Function SendMessageByString Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal sParam$) As Long
' Add API constant
Const LB_ITEMFROMPOINT = &H1A9
Const LB_SETTOPINDEX = &H197
Const LB_FINDSTRING = &H18F
Const LB_SELITEMRANGEEX = &H183
Dim Findstr As String
Dim FoundPos As Long
Dim FoundLine As Long
Dim fStart As Integer
Dim Replstr As String
Dim Inits As Byte
Dim LogFile$
Dim LogFileOut$
Dim i As Integer
Dim OldIndex As Integer
Dim hKey As Long
Dim lRetVal As Long
Dim Indy As Integer
Dim SelectedKeyNum As Integer
Dim Confirm As Long
Private Sub Form_Resize()
If WindowState = vbMinimized Then Exit Sub
'maximize the height and width to fit the screen
TV1.Height = (Me.Height - TV1.Top) - 850
List1.Height = (Me.Height - List1.Top) - 850
List1.Width = (Me.Width - List1.Left) - 200
List2.Top = List1.Top
List2.Height = List1.Height
List2.Width = List1.Width
Text1.Width = List1.Width
End Sub
Private Sub mExit_Click()
Unload Me
Set RecentDocs = Nothing
End
End Sub
Private Sub List1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyDelete Then
DeleteFromList True
End If
End Sub
Private Sub list1_DblClick()
OldIndex = List1.ListIndex
If OldIndex = -1 Then
End If
Text1.Text = List1.List(OldIndex)
cont:
End Sub
Private Sub List1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Private Sub TV1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyDelete Then
Confirm = MsgBox("Are you sure you want to delete all entries for " & TV1.SelectedItem.Text & "?", vbOKCancel + vbQuestion + vbMsgBoxSetForeground, "Confirm Deletion of Registry Values")
If Confirm = vbCancel Then Exit Sub
'
'delete all listings from the bottom up
For i = List1.ListCount - 1 To 0 Step -1
List1.ListIndex = i
If List1.Text <> AddSpace(Str$(i), 3) & vbTab Then
DeleteFromList False
End If
Next i
End If
End Sub
Private Sub TV1_NodeClick(ByVal Node As MSComctlLib.Node)