Aller au contenu


Photo
- - - - -

xp autoptimize


  • Veuillez vous connecter pour répondre
12 réponses à ce sujet

#11 jojoe

jojoe

    Mega Power Member

  • Membres
  • 221 messages

Posté 18 février 2004 - 01:49

salut ipl_001 t imagine bien que le prog je l ai scanne
plus d une fois avec mon norton 2004 pro a jour d
aujourd hui meme ensuite j ai fait un petit tour du
cote des parametre de mon firewall histoire de voir
si une connection suspecte ne si etait pas cree nada
tout va bien pour le moment a dans 3 jours


logitheque.com
nous filerais t ils un prog ripou ??????
c est pas le premier que je prend
jamais eu de probs :-P :-P :P :-(
  • 0

PUBLICITÉ

    Annonces Google

#12 jojoe

jojoe

    Mega Power Member

  • Membres
  • 221 messages

Posté 18 février 2004 - 01:57

voici le site du concepteur du logiciel

http://thomasnerrant.com/

j y suis aller mon ordi est toujour entier!!!!.lol
  • 0

#13 jojoe

jojoe

    Mega Power Member

  • Membres
  • 221 messages

Posté 18 février 2004 - 02:19

j ai trouve ce ficher dans le log pour ce
qui comprenent

//---------------------------------------------------------------------------
// Xp Autoptimize
// © Thomas Nerrant
// [URL=http://thomasnerrant.com]http://thomasnerrant.com[/URL]
// 02/2004
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Registry.hpp"
#include "Unit1.h"
#include <fstream.h>
#include <dirent.h>
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma link "TFlatCheckBoxUnit"
#pragma link "TFlatGaugeUnit"
#pragma link "TFlatButtonUnit"
#pragma link "TFlatComboBoxUnit"
#pragma resource "*.dfm"
TXpAutoptimize *XpAutoptimize;
//---------------------------------------------------------------------------
// load language file
void TXpAutoptimize::language(AnsiString filename){
int count=0;
fstream in(filename.c_str(),ios::in);
char Buffer[255];
while (count<57)
{
        in.getline(Buffer,255);
        if(count==0)
                GroupBox1->Caption=Buffer;
        if(count==1)
                GroupBox2->Caption=Buffer;
        if(count==2)
                GroupBox3->Caption=Buffer;
        if(count==3)
                GroupBox4->Caption=Buffer;
        if(count==4)
                GroupBox5->Caption=Buffer;
        if(count==5)
                FlatCheckBox1->Caption=Buffer;
        if(count==6)
                FlatCheckBox2->Caption=Buffer;
        if(count==7)
                FlatCheckBox3->Caption=Buffer;
        if(count==8)
                FlatCheckBox4->Caption=Buffer;
        if(count==9)
                FlatCheckBox5->Caption=Buffer;
        if(count==10)
                FlatCheckBox6->Caption=Buffer;
        if(count==11)
                FlatCheckBox7->Caption=Buffer;
        if(count==12)
                FlatCheckBox8->Caption=Buffer;
        if(count==13)
                FlatCheckBox9->Caption=Buffer;
        if(count==14)
                FlatCheckBox10->Caption=Buffer;
        if(count==15)
                FlatCheckBox11->Caption=Buffer;
        if(count==16)
                FlatCheckBox12->Caption=Buffer;
        if(count==17)
                FlatCheckBox13->Caption=Buffer;
        if(count==18)
                FlatCheckBox14->Caption=Buffer;
        if(count==19)
                FlatCheckBox15->Caption=Buffer;
        if(count==20)
                FlatCheckBox16->Caption=Buffer;
        if(count==21)
                FlatCheckBox17->Caption=Buffer;
        if(count==22)
                FlatCheckBox18->Caption=Buffer;
        if(count==23)
                FlatCheckBox19->Caption=Buffer;
        if(count==24)
                FlatCheckBox20->Caption=Buffer;
        if(count==25)
                FlatCheckBox21->Caption=Buffer;
        if(count==26)
                FlatCheckBox22->Caption=Buffer;
        if(count==27)
                Label1->Caption=Buffer;
        if(count==28)
                Label2->Caption=Buffer;
        if(count==29)
                Label3->Caption=Buffer;
        if(count==30)
                FlatButton1->Caption=Buffer;
        if(count==31)
                FlatButton2->Caption=Buffer;
        if(count==32)
                FlatButton3->Caption=Buffer;
        if(count==33)
                FlatCheckBox1->Hint=Buffer;
        if(count==34)
                FlatCheckBox2->Hint=Buffer;
        if(count==35)
                FlatCheckBox3->Hint=Buffer;
        if(count==36)
                FlatCheckBox4->Hint=Buffer;
        if(count==37)
                FlatCheckBox5->Hint=Buffer;
        if(count==38)
                FlatCheckBox6->Hint=Buffer;
        if(count==39)
                FlatCheckBox7->Hint=Buffer;
        if(count==40)
                FlatCheckBox8->Hint=Buffer;
        if(count==41)
                FlatCheckBox9->Hint=Buffer;
        if(count==42)
                FlatCheckBox10->Hint=Buffer;
        if(count==43)
                FlatCheckBox11->Hint=Buffer;
        if(count==44)
                FlatCheckBox12->Hint=Buffer;
        if(count==45)
                FlatCheckBox13->Hint=Buffer;
        if(count==46)
                FlatCheckBox14->Hint=Buffer;
        if(count==47)
                FlatCheckBox15->Hint=Buffer;
        if(count==48)
                FlatCheckBox16->Hint=Buffer;
        if(count==49)
                FlatCheckBox17->Hint=Buffer;
        if(count==50)
                FlatCheckBox18->Hint=Buffer;
        if(count==51)
                FlatCheckBox19->Hint=Buffer;
        if(count==52)
                FlatCheckBox20->Hint=Buffer;
        if(count==53)
                FlatCheckBox21->Hint=Buffer;
        if(count==54)
                FlatCheckBox22->Hint=Buffer;
        if(count==55)
                FlatComboBox1->Hint=Buffer;
        if(count==56)
                FlatComboBox2->Hint=Buffer;
        count++;
}
in.close();
}
//---------------------------------------------------------------------------
// read register values
void TXpAutoptimize::ReadRegister(){
Reg->RootKey = HKEY_LOCAL_MACHINE;

// No Defrag start files
if(Reg->KeyExists("\\SOFTWARE\\Microsoft\\Dfrg\\BootOptimizeFunction")){
        Reg->OpenKey("\\SOFTWARE\\Microsoft\\Dfrg\\BootOptimizeFunction",false);
        if(Reg->ValueExists("Enable")){
                if(Reg->ReadString("Enable")=="Y")
                {
                        FlatCheckBox1->Checked=true;
                }else{
                        FlatCheckBox1->Checked=false;
                }
        }
Reg->CloseKey();
}

// Shutdown computer after system log-off
if(Reg->KeyExists("\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon")){
        Reg->OpenKey("\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon",false);
        if(Reg->ValueExists("PowerDownAfterShutdown")){
                if(Reg->ReadString("PowerDownAfterShutdown")=="1")
                {
                        FlatCheckBox2->Checked=true;
                }else{
                        FlatCheckBox2->Checked=false;
                }
        }
Reg->CloseKey();
}

// Stop services quickly
if(Reg->KeyExists("\\SYSTEM\\CurrentControlSet\\Control")){
        Reg->OpenKey("\\SYSTEM\\CurrentControlSet\\Control",false);
        if(Reg->ValueExists("WaitToKillServiceTimeout")){
                if(Reg->ReadString("WaitToKillServiceTimeout")=="1000")
                {
                        FlatCheckBox4->Checked=true;
                }else{
                        FlatCheckBox4->Checked=false;
                }
        }
Reg->CloseKey();
}

// Ultra DMA 66
if(Reg->KeyExists("\\SYSTEM\\CurrentControlSet\\Control\\Class\\{4D36E96A-E325-11CE-BFC1-08002BE10318}")){
        Reg->OpenKey("\\SYSTEM\\CurrentControlSet\\Control\\Class\\{4D36E96A-E325-11CE-BFC1-08002BE10318}",false);
        if(Reg->ValueExists("EnableUDMA66")){
                if(Reg->ReadInteger("EnableUDMA66")==1)
                {
                        FlatCheckBox6->Checked=true;
                }else{
                        FlatCheckBox6->Checked=false;
                }
        }
Reg->CloseKey();
}

// Ntfs optimization
if(Reg->KeyExists("\\SYSTEM\\CurrentControlSet\\Control\\FileSystem")){
        Reg->OpenKey("\\SYSTEM\\CurrentControlSet\\Control\\FileSystem",false);
        if(Reg->ValueExists("NtfsDisableLastAccessUpdate")){
                if(Reg->ReadInteger("NtfsDisableLastAccessUpdate")==1)
                {
                     FlatCheckBox8->Checked=true;
                }else{
                     FlatCheckBox8->Checked=false;
                }
        }
Reg->CloseKey();
}

// Memory management
if(Reg->KeyExists("\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Memory Management")){
        Reg->OpenKey("\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Memory Management",false);
        if(Reg->ValueExists("IoPageLockLimit")){
                if(Reg->ReadInteger("IoPageLockLimit")==106496)
                        FlatComboBox1->ItemIndex=0;
                if(Reg->ReadInteger("IoPageLockLimit")==221184)
                        FlatComboBox1->ItemIndex=1;
                if(Reg->ReadInteger("IoPageLockLimit")==458752)
                        FlatComboBox1->ItemIndex=2;
        }
Reg->CloseKey();
}

// Memory optimization
if(Reg->KeyExists("\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Memory Management")){
        Reg->OpenKey("\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Memory Management",false);
        if(Reg->ValueExists("DisablePagingExecutive")){
                if(Reg->ReadInteger("DisablePagingExecutive")==1)
                {
                        FlatCheckBox9->Checked=true;
                }else{
                        FlatCheckBox9->Checked=false;
                }
        }
Reg->CloseKey();
}

// kill dll from memory
if(Reg->KeyExists("\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer")){
        Reg->OpenKey("\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer",false);
        if(Reg->ValueExists("AlwaysUnloadDll")){
                if(Reg->ReadInteger("AlwaysUnloadDll")==1)
                {
                        FlatCheckBox10->Checked=true;
                }else{
                        FlatCheckBox10->Checked=false;
                }
        }
Reg->CloseKey();
}

// swap empty
if(Reg->KeyExists("\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Memory Management")){
        Reg->OpenKey("\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Memory Management",false);
        if(Reg->ValueExists("ClearPageFileAtShutdown")){
                if(Reg->ReadInteger("ClearPageFileAtShutdown")==1)
                {
                        FlatCheckBox11->Checked=true;
                }else{
                        FlatCheckBox11->Checked=false;
                }
        }
Reg->CloseKey();
}

// faster xp
if(Reg->KeyExists("\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\RemoteComputer\\NameSpace")){
        Reg->OpenKey("\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\RemoteComputer\\NameSpace",false);
        if(Reg->KeyExists("{D6277990-4C6A-11CF-8D87-00AA0060F5BF}")){
                FlatCheckBox12->Checked=false;
        }else{
                FlatCheckBox12->Checked=true;
        }
Reg->CloseKey();
}

// IE security
if(Reg->KeyExists("\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\ZoneMap\\ProtocolDefaults")){
        Reg->OpenKey("\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\ZoneMap\\ProtocolDefaults",false);
        if(Reg->ValueExists("about")&&Reg->ValueExists("about:")){
                if(Reg->ReadInteger("about")==4&&Reg->ReadInteger("about:")==4){
                        FlatCheckBox13->Checked=true;
                }else{
                        FlatCheckBox13->Checked=false;
                }
        }
Reg->CloseKey();
}

// ICMP redirect
if(Reg->KeyExists("\\SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters")){
        Reg->OpenKey("\\SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters",false);
        if(Reg->ValueExists("EnableICMPRedirect")){
                if(Reg->ReadInteger("EnableICMPRedirect")==0)
                {
                        FlatCheckBox15->Checked=true;
                }else{
                        FlatCheckBox15->Checked=false;
                }
        }
Reg->CloseKey();
}

// PMTU
if(Reg->KeyExists("\\SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters")){
        Reg->OpenKey("\\SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters",false);
        if(Reg->ValueExists("EnablePMTUDiscovery")){
                if(Reg->ReadInteger("EnablePMTUDiscovery")==1)
                {
                        FlatCheckBox16->Checked=true;
                }else{
                        FlatCheckBox16->Checked=false;
                }
        }
Reg->CloseKey();
}

// TTL
if(Reg->KeyExists("\\SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters")){
        Reg->OpenKey("\\SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters",false);
        if(Reg->ValueExists("DefaultTTL")){
                if(Reg->ReadInteger("DefaultTTL")==32)
                        FlatComboBox2->ItemIndex=0;
                if(Reg->ReadInteger("DefaultTTL")==64)
                        FlatComboBox2->ItemIndex=1;
                if(Reg->ReadInteger("DefaultTTL")==128)
                        FlatComboBox2->ItemIndex=2;
                if(Reg->ReadInteger("DefaultTTL")==256)
                        FlatComboBox2->ItemIndex=3;
        }
Reg->CloseKey();
}

// Internet connection optimized
if(Reg->KeyExists("\\SYSTEM\\CurrentControlSet\\Services\\LanmanWorkstation\\Parameters")){
        Reg->OpenKey("\\SYSTEM\\CurrentControlSet\\Services\\LanmanWorkstation\\Parameters",false);
        if(Reg->ValueExists("MaxCmds")&&Reg->ValueExists("MaxThreads")){
                if(Reg->ReadInteger("MaxCmds")==100&&Reg->ReadInteger("MaxThreads")==100)
                {
                        FlatCheckBox18->Checked=true;
                }else{
                        FlatCheckBox18->Checked=false;
                }
        }
Reg->CloseKey();
}

// error reports
if(Reg->KeyExists("\\SOFTWARE\\Microsoft\\PCHealth\\ErrorReporting")){
        Reg->OpenKey("\\SOFTWARE\\Microsoft\\PCHealth\\ErrorReporting",false);
        if(Reg->ValueExists("AllOrNone")&&Reg->ValueExists("IncludeMicrosoftApps")&&Reg->ValueExists("IncludeWindowsApps")&&Reg->ValueExists("IncludeKernelFaults")&&Reg->ValueExists("DoReport")&&Reg->ValueExists("ShowUI")){
                if(Reg->ReadInteger("AllOrNone")==0&&Reg->ReadInteger("IncludeMicrosoftApps")==0&&Reg->ReadInteger("IncludeWindowsApps")==0&&Reg->ReadInteger("IncludeKernelFaults")==0&&Reg->ReadInteger("DoReport")==0&&Reg->ReadInteger("ShowUI")==0){
                        FlatCheckBox19->Checked=true;
                }else{
                        FlatCheckBox19->Checked=false;
                }
        }
Reg->CloseKey();
}

// anonymous connections
if(Reg->KeyExists("\\SYSTEM\\CurrentControlSet\\Control\\Lsa")){
        Reg->OpenKey("\\SYSTEM\\CurrentControlSet\\Control\\Lsa",false);
        if(Reg->ValueExists("restrictanonymous")){
                if(Reg->ReadInteger("restrictanonymous")==1){
                        FlatCheckBox20->Checked=true;
                }else{
                        FlatCheckBox20->Checked=false;
                }
        }
Reg->CloseKey();
}

// deactivate msn
if(Reg->KeyExists("\\SOFTWARE\\Policies\\Microsoft\\Messenger\\Client")){
        Reg->OpenKey("\\SOFTWARE\\Policies\\Microsoft\\Messenger\\Client",false);
        if(Reg->ValueExists("PreventRun")){
                if(Reg->ReadInteger("PreventRun")==1){
                        FlatCheckBox21->Checked=true;
                }else{
                        FlatCheckBox21->Checked=false;
                }
        }
Reg->CloseKey();
}

// Windows privacy
if(Reg->KeyExists("\\SOFTWARE\\Microsoft\\Internet Explorer\\Main")){
        Reg->OpenKey("\\SOFTWARE\\Microsoft\\Internet Explorer\\Main",false);
        if(Reg->ValueExists("IEWatsonDisabled")){
                if(Reg->ReadInteger("IEWatsonDisabled")==1){
                        FlatCheckBox22->Checked=true;
                }else{
                        FlatCheckBox22->Checked=false;
                }
        }
Reg->CloseKey();
}


/////////////////////////////////
Reg->RootKey = HKEY_CURRENT_USER;

// Optimize the Windows Shutdown
if(Reg->KeyExists("\\Control Panel\\Desktop")){
        Reg->OpenKey("\\Control Panel\\Desktop",false);
        if(Reg->ValueExists("AutoEndTasks")){
                if(Reg->ReadString("AutoEndTasks")=="1")
                {
                        FlatCheckBox3->Checked=true;
                }else{
                        FlatCheckBox3->Checked=false;
                }
        }
Reg->CloseKey();
}

// Stable explorer
if(Reg->KeyExists("\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer")){
        Reg->OpenKey("\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer",false);
        if(Reg->ValueExists("DesktopProcess")){
                if(Reg->ReadInteger("DesktopProcess")==1)
                {
                        FlatCheckBox5->Checked=true;
                }else{
                        FlatCheckBox5->Checked=false;
                }
        }
Reg->CloseKey();
}

// Low disk notification
if(Reg->KeyExists("\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer")){
        Reg->OpenKey("\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer",false);
        if(Reg->ValueExists("NoLowDiskSpaceCheck")){
                if(Reg->ReadInteger("NoLowDiskSpaceCheck")==1)
                {
                        FlatCheckBox7->Checked=true;
                }else{
                        FlatCheckBox7->Checked=false;
                }
        }
Reg->CloseKey();
}

// Wmp bug
if(Reg->KeyExists("\\Software\\Microsoft\\MediaPlayer\\Preferences")){
        Reg->OpenKey("\\Software\\Microsoft\\MediaPlayer\\Preferences",false);
        if(Reg->ValueExists("PlayerScriptCommandsEnabled")){
                if(Reg->ReadInteger("PlayerScriptCommandsEnabled")==0)
                {
                        FlatCheckBox14->Checked=true;
                }else{
                        FlatCheckBox14->Checked=false;
                }
        }
Reg->CloseKey();
}

// several connections
if(Reg->KeyExists("\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings")){
        Reg->OpenKey("\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings",false);
        if(Reg->ValueExists("MaxConnectionsPer1_0Server")&&Reg->ValueExists("MaxConnectionsPerServer")){
                if(Reg->ReadInteger("MaxConnectionsPer1_0Server")==8&&Reg->ReadInteger("MaxConnectionsPerServer")==4)
                {
                        FlatCheckBox17->Checked=true;
                }else{
                        FlatCheckBox17->Checked=false;
                }
        }
Reg->CloseKey();
}

}
//---------------------------------------------------------------------------
// write register values
void TXpAutoptimize::WriteRegister(){
Reg->RootKey = HKEY_LOCAL_MACHINE;

// No Defrag start files
Reg->OpenKey("\\SOFTWARE\\Microsoft\\Dfrg\\BootOptimizeFunction",true);
if(FlatCheckBox1->Checked==true)
{
        Reg->WriteString("Enable","Y");
}else{
        Reg->WriteString("Enable","N");
}
Reg->CloseKey();
FlatGauge1->Progress++;

// Shutdown computer after system log-off
Reg->OpenKey("\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon",true);
if(FlatCheckBox2->Checked==true)
{
        Reg->WriteString("PowerDownAfterShutdown","1");
}else{
        Reg->WriteString("PowerDownAfterShutdown","0");
}
Reg->CloseKey();
FlatGauge1->Progress++;

// Stop services quickly
Reg->OpenKey("\\SYSTEM\\CurrentControlSet\\Control",true);
if(FlatCheckBox4->Checked==true)
{
        Reg->WriteString("WaitToKillServiceTimeout","1000");
}else{
        Reg->WriteString("WaitToKillServiceTimeout","20000");
}
Reg->CloseKey();
FlatGauge1->Progress++;

// Ultra DMA 66
Reg->OpenKey("\\SYSTEM\\CurrentControlSet\\Control\\Class\\{4D36E96A-E325-11CE-BFC1-08002BE10318}",true);
if(FlatCheckBox6->Checked==true)
{
        Reg->WriteInteger("EnableUDMA66",1);
}else{
        Reg->DeleteValue("EnableUDMA66");
}
Reg->CloseKey();
FlatGauge1->Progress++;

// Ntfs Optimized
Reg->OpenKey("\\SYSTEM\\CurrentControlSet\\Control\\FileSystem",true);
if(FlatCheckBox8->Checked==true)
{
        Reg->WriteInteger("NtfsDisableLastAccessUpdate",1);
}else{
        Reg->WriteInteger("NtfsDisableLastAccessUpdate",0);
}
Reg->CloseKey();
FlatGauge1->Progress++;

// Memory Management
Reg->OpenKey("\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Memory Management",true);
if(FlatComboBox1->ItemIndex==0)
        Reg->WriteInteger("IoPageLockLimit",106496);
if(FlatComboBox1->ItemIndex==1)
        Reg->WriteInteger("IoPageLockLimit",221184);
if(FlatComboBox1->ItemIndex==2)
        Reg->WriteInteger("IoPageLockLimit",458752);
Reg->CloseKey();
FlatGauge1->Progress++;

// Memory Optimized
Reg->OpenKey("\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Memory Management",true);
if(FlatCheckBox9->Checked==true)
{
        Reg->WriteInteger("DisablePagingExecutive",1);
}else{
        Reg->WriteInteger("DisablePagingExecutive",0);
}
Reg->CloseKey();
FlatGauge1->Progress++;

// kill dll from memory
Reg->OpenKey("\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer",true);
if(FlatCheckBox10->Checked==true)
{
        Reg->WriteInteger("AlwaysUnloadDll",1);
}else{
        Reg->WriteInteger("AlwaysUnloadDll",0);
}
Reg->CloseKey();
FlatGauge1->Progress++;

// empty swap
Reg->OpenKey("\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Memory Management",true);
if(FlatCheckBox11->Checked==true)
{
        Reg->WriteInteger("ClearPageFileAtShutdown",1);
}else{
        Reg->WriteInteger("ClearPageFileAtShutdown",0);
}
Reg->CloseKey();
FlatGauge1->Progress++;

// faster xp
Reg->OpenKey("\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\RemoteComputer\\NameSpace",true);
if(FlatCheckBox12->Checked==true)
{
        Reg->DeleteKey("{D6277990-4C6A-11CF-8D87-00AA0060F5BF}");
}else{
        Reg->CreateKey("{D6277990-4C6A-11CF-8D87-00AA0060F5BF}");
}
Reg->CloseKey();
FlatGauge1->Progress++;

// IE security
Reg->OpenKey("\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\ZoneMap\\ProtocolDefaults",true);
if(FlatCheckBox13->Checked==true)
{
        Reg->WriteInteger("about",4);
        Reg->WriteInteger("about:",4);
}else{
        Reg->DeleteValue("about:");
        Reg->DeleteValue("about:");
}
Reg->CloseKey();
FlatGauge1->Progress++;

// ICMP redirect
Reg->OpenKey("\\SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters",true);
if(FlatCheckBox15->Checked==true)
{
        Reg->WriteInteger("EnableICMPRedirect",0);
}else{
        Reg->WriteInteger("EnableICMPRedirect",1);
}
Reg->CloseKey();
FlatGauge1->Progress++;

// PMTU
Reg->OpenKey("\\SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters",true);
if(FlatCheckBox16->Checked==true)
{
        Reg->WriteInteger("EnablePMTUDiscovery",1);
}else{
        Reg->WriteInteger("EnablePMTUDiscovery",0);
}
Reg->CloseKey();
FlatGauge1->Progress++;

// TTL
Reg->OpenKey("\\SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters",true);
if(FlatComboBox2->ItemIndex==0)
        Reg->WriteInteger("DefaultTTL",32);
if(FlatComboBox2->ItemIndex==1)
        Reg->WriteInteger("DefaultTTL",64);
if(FlatComboBox2->ItemIndex==2)
        Reg->WriteInteger("DefaultTTL",128);
if(FlatComboBox2->ItemIndex==3)
        Reg->WriteInteger("DefaultTTL",256);
Reg->CloseKey();
FlatGauge1->Progress++;

// Internet connection optimized
Reg->OpenKey("\\SYSTEM\\CurrentControlSet\\Services\\LanmanWorkstation\\Parameters",true);
if(FlatCheckBox18->Checked==true)
{
        Reg->WriteInteger("MaxCmds",100);
        Reg->WriteInteger("MaxThreads",100);
}else{
        Reg->WriteInteger("MaxCmds",21);
        Reg->WriteInteger("MaxThreads",21);
}
Reg->CloseKey();
FlatGauge1->Progress++;

// error reports
Reg->OpenKey("\\SOFTWARE\\Microsoft\\PCHealth\\ErrorReporting",true);
if(FlatCheckBox19->Checked==true)
{
        Reg->WriteInteger("AllOrNone",0);
        Reg->WriteInteger("IncludeMicrosoftApps",0);
        Reg->WriteInteger("IncludeWindowsApps",0);
        Reg->WriteInteger("IncludeKernelFaults",0);
        Reg->WriteInteger("DoReport",0);
        Reg->WriteInteger("ShowUI",0);
}else{
        Reg->WriteInteger("AllOrNone",1);
        Reg->WriteInteger("IncludeMicrosoftApps",1);
        Reg->WriteInteger("IncludeWindowsApps",1);
        Reg->WriteInteger("IncludeKernelFaults",1);
        Reg->WriteInteger("DoReport",1);
        Reg->WriteInteger("ShowUI",1);
}
Reg->CloseKey();
FlatGauge1->Progress++;

// anonymous connections
Reg->OpenKey("\\SYSTEM\\CurrentControlSet\\Control\\Lsa",true);
if(FlatCheckBox20->Checked==true)
{
        Reg->WriteInteger("restrictanonymous",1);
}else{
        Reg->WriteInteger("restrictanonymous",0);
}
Reg->CloseKey();
FlatGauge1->Progress++;

// deactivate msn
Reg->OpenKey("\\SOFTWARE\\Policies\\Microsoft\\Messenger\\Client",true);
if(FlatCheckBox21->Checked==true)
{
        Reg->WriteInteger("PreventRun",1);
}else{
        Reg->WriteInteger("PreventRun",0);
}
Reg->CloseKey();
FlatGauge1->Progress++;

// windows privacy
Reg->OpenKey("\\SOFTWARE\\Microsoft\\Internet Explorer\\Main",true);
if(FlatCheckBox22->Checked==true)
{
        Reg->WriteInteger("IEWatsonDisabled",1);
}else{
        Reg->WriteInteger("IEWatsonDisabled",0);
}
Reg->CloseKey();
FlatGauge1->Progress++;


/////////////////////////////////
Reg->RootKey = HKEY_CURRENT_USER;

// Optimize the Windows Shutdown
Reg->OpenKey("\\Control Panel\\Desktop",true);
if(FlatCheckBox3->Checked==true)
{
        Reg->WriteString("AutoEndTasks","1");
}else{
        Reg->WriteString("AutoEndTasks","0");
}
Reg->CloseKey();
FlatGauge1->Progress++;

// Stable explorer
Reg->OpenKey("\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer",true);
if(FlatCheckBox5->Checked==true)
{
        Reg->WriteInteger("DesktopProcess",1);
}else{
        Reg->WriteInteger("DesktopProcess",0);
}
Reg->CloseKey();
FlatGauge1->Progress++;

// Low disk notification
Reg->OpenKey("\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer",true);
if(FlatCheckBox7->Checked==true)
{
        Reg->WriteInteger("NoLowDiskSpaceCheck",1);
}else{
        Reg->WriteInteger("NoLowDiskSpaceCheck",0);
}
Reg->CloseKey();
FlatGauge1->Progress++;

// wmp bug
Reg->OpenKey("\\Software\\Microsoft\\MediaPlayer\\Preferences",true);
if(FlatCheckBox14->Checked==true)
{
        Reg->WriteInteger("PlayerScriptCommandsEnabled",0);
}else{
        Reg->DeleteValue("PlayerScriptCommandsEnabled");
}
Reg->CloseKey();
FlatGauge1->Progress++;

// several connections
Reg->OpenKey("\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings",true);
if(FlatCheckBox17->Checked==true)
{
        Reg->WriteInteger("MaxConnectionsPer1_0Server",8);
        Reg->WriteInteger("MaxConnectionsPerServer",4);
}else{
        Reg->DeleteValue("MaxConnectionsPer1_0Server");
        Reg->DeleteValue("MaxConnectionsPerServer");
}
Reg->CloseKey();
FlatGauge1->Progress++;

}
//---------------------------------------------------------------------------
__fastcall TXpAutoptimize::TXpAutoptimize(TComponent* Owner)
        : TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TXpAutoptimize::FormCreate(TObject *Sender)
{
// We create the Registry instance
Reg = new TRegistry;
FlatGauge1->MaxValue=24;
Application->OnHint = DisplayHint;
}
//---------------------------------------------------------------------------
void __fastcall TXpAutoptimize::FormClose(TObject *Sender,
      TCloseAction &Action)
{
delete Reg;
}
//---------------------------------------------------------------------------
void __fastcall TXpAutoptimize::FormActivate(TObject *Sender)
{
// We read the actual registry
ReadRegister();

// we load language files included in the same directory than the program
DIR *dir;
struct dirent *ent;
if ((dir = opendir(ExtractFilePath(Application->ExeName).c_str())) == NULL)
        exit(NULL);
AnsiString temp;
while ((ent = readdir(dir)) != NULL)
{
        temp = ent->d_name;
                if(ExtractFileExt(temp)==".lng")
                        FlatComboBox3->Items->Add(temp);
}
closedir(dir);
delete dir;

char buf[255];
fstream in("config.cfg",ios::in);
in.getline(buf,255);
in.close();

AnsiString filename=buf;
int lbl=0;
for(int i=0;i<FlatComboBox3->Items->Count;i++){
        if(filename==FlatComboBox3->Items->Strings[i])
                lbl=1;
}
if(lbl==0){
DeleteFile("config.cfg");
}else{
FlatComboBox3->ItemIndex=FlatComboBox3->Items->IndexOf(filename);
language(filename);
}
}
//---------------------------------------------------------------------------
void __fastcall TXpAutoptimize::FlatButton3Click(TObject *Sender)
{
// we save registry values and close the program
WriteRegister();
}
//---------------------------------------------------------------------------
void __fastcall TXpAutoptimize::Image1Click(TObject *Sender)
{
ShellExecute(this->Handle,"open","http://thomasnerrant.com",0,0,SW_NORMAL);
}
//---------------------------------------------------------------------------
void __fastcall TXpAutoptimize::FlatComboBox3Change(TObject *Sender)
{
// change of language
AnsiString filename=FlatComboBox3->Items->Strings[FlatComboBox3->ItemIndex];
language(filename);
fstream out("config.cfg",ios::out);
out.write(filename.c_str(),filename.Length());
out.close();
}
//---------------------------------------------------------------------------
void __fastcall TXpAutoptimize::FlatButton1Click(TObject *Sender)
{
// default register values
FlatCheckBox1->Checked=true;
FlatCheckBox2->Checked=true;
FlatCheckBox3->Checked=false;
FlatCheckBox4->Checked=false;
FlatCheckBox5->Checked=false;
FlatCheckBox6->Checked=false;
FlatCheckBox7->Checked=false;
FlatCheckBox8->Checked=false;
FlatCheckBox9->Checked=false;
FlatCheckBox10->Checked=false;
FlatCheckBox11->Checked=false;
FlatCheckBox12->Checked=false;
FlatCheckBox13->Checked=false;
FlatCheckBox14->Checked=false;
FlatCheckBox15->Checked=false;
FlatCheckBox16->Checked=false;
FlatCheckBox17->Checked=false;
FlatCheckBox18->Checked=false;
FlatCheckBox19->Checked=false;
FlatCheckBox20->Checked=false;
FlatCheckBox21->Checked=false;
FlatCheckBox22->Checked=false;
FlatComboBox2->ItemIndex=0;
}
//---------------------------------------------------------------------------
void __fastcall TXpAutoptimize::FlatButton2Click(TObject *Sender)
{
// default register values
FlatCheckBox1->Checked=true;
FlatCheckBox2->Checked=true;
FlatCheckBox3->Checked=true;
FlatCheckBox4->Checked=true;
FlatCheckBox8->Checked=true;
FlatCheckBox9->Checked=true;
FlatCheckBox10->Checked=true;
FlatCheckBox11->Checked=true;
FlatCheckBox12->Checked=true;
FlatCheckBox13->Checked=true;
FlatCheckBox14->Checked=true;
FlatCheckBox15->Checked=true;
FlatCheckBox16->Checked=true;
FlatCheckBox17->Checked=true;
FlatCheckBox18->Checked=true;
FlatCheckBox19->Checked=true;
FlatCheckBox20->Checked=true;
FlatCheckBox21->Checked=true;
FlatCheckBox22->Checked=true;
FlatComboBox2->ItemIndex=3;
}
//---------------------------------------------------------------------------
void __fastcall TXpAutoptimize::DisplayHint(TObject *Sender)
{
  StatusBar1->SimpleText = GetLongHint(Application->Hint);
}

  • 0