Vous êtes sur la page 1sur 6

Private Function Save_Settings() As Boolean

On Error Resume Next

Save_Settings = True

'HotKey

Set_Reg_Data r_Activate_HotKey, chkActivateHotKey.Value

intHotKeyActivated = chkActivateHotKey.Value

Set_Reg_Data r_HotKey_Letter, cmbKeySelect.Text, 1

If chkActivateHotKey.Value = 1 Then

'HotKey_Unload (frmTray.hwnd)

If HotKey_Load(frmTray.hwnd) = 0 Then

CenterMsgBoxOnForm Me, "HotKey is already in use. Please try


another.", _

vbExclamation, "HotKey Apply"

Save_Settings = False

cmbKeySelect.SetFocus

Exit Function

End If

Else

HotKey_Unload (frmTray.hwnd)

End If

'Starup

If chkStartup = 1 Then

Dim sExePath As String

sExePath = IIf(Right(App.Path, 1) = "\", _

App.Path & App.EXEName & ".exe" & " /cls_cnt", _

App.Path & "\" & App.EXEName & ".exe" & " /cls_cnt")

Set_Reg_Data r_Startup_Reg, sExePath, 1


Else

Remove_Reg_Data (r_Startup_Reg)

strStartupStatus = ""

End If

'System tray

Set_Reg_Data r_Add_Tray, chkShowInTray.Value

intShowInTray = chkShowInTray.Value

If intTrayLoaded = 1 And intShowInTray = 0 Then

frmTray.Remove_from_tray

ElseIf intTrayLoaded = 0 And intShowInTray = 1 Then

frmTray.Add_to_tray

End If

'Play sounds

Set_Reg_Data r_Play_Sounds, chkPlaySounds.Value

intPlay_Sound = chkPlaySounds.Value

'Set erase PC tracks when application exists.

Set_Reg_Data r_Clear_Exit, chkErasewhenExit.Value

intClear_When_Exit = chkErasewhenExit.Value

'Settings for Erase PC tracks

Dim i As Integer

For i = 0 To 3

If chkOpt(i).Value = 1 Then

Select Case i

Case 0

Set_Reg_Data r_clear_opt1, 1

Case 1

Set_Reg_Data r_clear_opt2, 1

Case 2

Set_Reg_Data r_clear_opt3, 1
Case 3

Set_Reg_Data r_clear_opt4, 1

End Select

ElseIf chkOpt(i).Value = 0 Then

Select Case i

Case 0

Set_Reg_Data r_clear_opt1, 0

Case 1

Set_Reg_Data r_clear_opt2, 0

Case 2

Set_Reg_Data r_clear_opt3, 0

Case 3

Set_Reg_Data r_clear_opt4, 0

End Select

End If

Next i

Set_Reg_Data r_Show_Message, chkApplyPCTracks.Value

'Default Privacy Block.

If cmbPrivacyBlock = cmbPrivacyBlock.List(0) Then

Remove_Reg_Data (r_Default_Privacy_Block)

Else

Set_Reg_Data r_Default_Privacy_Block, cmbPrivacyBlock, 1

End If

End Function

'Erase PC tracks based on the settings.

Public Sub Clear_PC_Tracks()


On Error Resume Next

Dim i As Integer

For i = 0 To 3

If chkOpt(i).Value = 1 Then

Select Case i

Case 0

Clear_Recent_Contents

pCt.sStatus0 = "Erased"

Case 1

Remove_Reg_Data (MediaL)

pCt.sStatus1 = "Erased"

Case 2

Remove_Reg_Data (RunL)

pCt.sStatus2 = "Erased"

Case 3

Remove_Reg_Data (SearchL)

Remove_Reg_Data (SearchComputerL1)

Call Remove_Reg_Key(HKCU, SearchComputerL2)

Call Remove_Reg_Key(HKCU, NewSearchList)

pCt.sStatus3 = "Erased"

End Select

ElseIf chkOpt(i).Value = 0 Then

Select Case i

Case 0

pCt.sStatus0 = "Not Erased"

Case 1

pCt.sStatus1 = "Not Erased"

Case 2

pCt.sStatus2 = "Not Erased"


Case 3

pCt.sStatus3 = "Not Erased"

End Select

End If

Next i

'If intStartupCmd = 1 Then

'On Error GoTo Err

'If Read_Reg_Data(r_Show_Message) = 1 Then frmClearMessage.Show

'Else

' frmClearMessage.Show 1

'End If

frmClearMessage.Show 1

'Apply Registry refresh.

SHChangeNotify SHCNE_ASSOCCHANGED, SHCNF_IDLIST, 0, 0

Exit Sub

Err:

frmClearMessage.Show

End Sub

'Remove recent contents (support for Windows XP, Vista, Win7, and Win8)

Private Sub Clear_Recent_Contents()

On Error Resume Next

Kill strSystemRecent & "\*.*"

Kill strSystemRecent & "\CustomDestinations\*.*"

Kill strSystemRecent & "\AutomaticDestinations\*.*"

Call Remove_Reg_Key(HKCU, RecentListReg)


Call Remove_Reg_Key(HKCU, OpenedComDlgList)

Call Remove_Reg_Key(HKCU, SavedComDlgList)

End Sub