safi Posted January 4, 2010 Posted January 4, 2010 hi every body i need you 2 give me information about my small program and i want you 2 give me more details 2 improve it expandcollapse popup#include <GuiConstants.au3> Opt("GUICloseOnESC", 1) $Window = GUICreatE("CHOZENX",250,350,250,150) $button1 = GUICtrlCreateButton("START UP SYSTEM", 30,50,200,30) $button2 = GUICtrlCreateButton("START UP MODEM", 30,100,200,30) $button3 = GUICtrlCreateButton("SOLVE NTFS FOLDERS PROBLEM", 30,150,200,30) $button4 = GUICtrlCreateButton("EXIT", 75,220,100,25) $button5 = GUICtrlCreateButton("ABOUT", 75,250,100,20) GUISetState() While 1 $c = GUIGetMsg() if $c = $button1 Then SYS() EndIf if $c = $button2 Then MODEM() EndIf if $c = $button3 Then NTFS() EndIf if $c = $button4 Then SEXIT() EndIf IF $C = $button5 Then about() EndIf If $c = $GUI_EVENT_CLOSE Then sExit() EndIf WEnd ;=====================================================================functions Func SYS() RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management\PrefetchParameters","EnablePrefetcher","REG_DWORD",5) RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management","ClearPageFileAtShutdown","REG_DWORD",0) RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management","DisablePagingExecutive","REG_DWORD",1) RegWrite("HKEY_CURRENT_USER\CONTROL PANEL\DESKTOP","MenuShowDelay","REG_SZ",150) RegWrite("HKEY_CURRENT_USER\CONTROL PANEL\DESKTOP","HUNGAPPTIMEOUT","REG_SZ",5000) RegWrite("HKEY_CURRENT_USER\CONTROL PANEL\DESKTOP","WAITTOKILLAPPTIMEOUT","REG_SZ",4000) EndFunc Func MODEM() RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Dnscache\Parameters","CacheHashTableBucketSize","REG_DWORD","1") RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Dnscache\Parameters","CacheHashTableSize","REG_DWORD","384" ) RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Dnscache\Parameters","MaxCacheEntryTtlLimit","REG_DWORD","64000") RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Dnscache\Parameters","MaxSOACacheEntryTtlLimit","REG_DWORD","301" ) EndFunc Func NTFS() RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem","NtfsDisable8dot3NameCreation","REG_DWORD",0) RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem","Win31FileSystem","REG_DWORD",0) RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem","Win95TruncatedExtensions","REG_DWORD",1) RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem","NtfsDisableLastAccessUpdate","REG_DWORD",1) EndFunc Func about() MsgBox(0,".... ^_^ .... ^_^ .... ^_^ ....","This humble Program is Designed to you by"&@CRLF&@CRLF&" ChozenX") EndFunc Func SEXIT() Exit EndFunc
James Posted January 4, 2010 Posted January 4, 2010 Run Tidy, edit your horrible if statements, remove some redundant functions and voila... expandcollapse popup#include <GuiConstants.au3> Opt("GUICloseOnESC", 1) $Window = GUICreate("CHOZENX", 250, 350, 250, 150) $button1 = GUICtrlCreateButton("START UP SYSTEM", 30, 50, 200, 30) $button2 = GUICtrlCreateButton("START UP MODEM", 30, 100, 200, 30) $button3 = GUICtrlCreateButton("SOLVE NTFS FOLDERS PROBLEM", 30, 150, 200, 30) $button4 = GUICtrlCreateButton("EXIT", 75, 220, 100, 25) $button5 = GUICtrlCreateButton("ABOUT", 75, 250, 100, 20) GUISetState() While 1 $c = GUIGetMsg() Switch $c Case $GUI_EVENT_CLOSE sExit() Case $button1 SYS() Case $button2 MODEM() Case $button3 NTFS() Case $button4 Exit Case $button5 MsgBox(0, ".... ^_^ .... ^_^ .... ^_^ ....", "This humble Program is Designed to you by" & @CRLF & @CRLF & " ChozenX") EndSwitch WEnd ;=====================================================================functions Func SYS() RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management\PrefetchParameters", "EnablePrefetcher", "REG_DWORD", 5) RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management", "ClearPageFileAtShutdown", "REG_DWORD", 0) RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management", "DisablePagingExecutive", "REG_DWORD", 1) RegWrite("HKEY_CURRENT_USER\CONTROL PANEL\DESKTOP", "MenuShowDelay", "REG_SZ", 150) RegWrite("HKEY_CURRENT_USER\CONTROL PANEL\DESKTOP", "HUNGAPPTIMEOUT", "REG_SZ", 5000) RegWrite("HKEY_CURRENT_USER\CONTROL PANEL\DESKTOP", "WAITTOKILLAPPTIMEOUT", "REG_SZ", 4000) EndFunc ;==>SYS Func MODEM() RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Dnscache\Parameters", "CacheHashTableBucketSize", "REG_DWORD", "1") RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Dnscache\Parameters", "CacheHashTableSize", "REG_DWORD", "384") RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Dnscache\Parameters", "MaxCacheEntryTtlLimit", "REG_DWORD", "64000") RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Dnscache\Parameters", "MaxSOACacheEntryTtlLimit", "REG_DWORD", "301") EndFunc ;==>MODEM Func NTFS() RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem", "NtfsDisable8dot3NameCreation", "REG_DWORD", 0) RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem", "Win31FileSystem", "REG_DWORD", 0) RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem", "Win95TruncatedExtensions", "REG_DWORD", 1) RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem", "NtfsDisableLastAccessUpdate", "REG_DWORD", 1) EndFunc ;==>NTFS Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ
James Posted January 4, 2010 Posted January 4, 2010 I would use Select for $cFunction GUICtrlCreateButtonWhy? Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ
safi Posted January 5, 2010 Author Posted January 5, 2010 :evil: thanx 2 you i will try next time 2 improve it
James Posted January 5, 2010 Posted January 5, 2010 :evil: thanx 2 you i will try next time 2 improve it Why? The code is there for you to use now. Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ
safi Posted January 5, 2010 Author Posted January 5, 2010 i know that but 2 try another one with another ways
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now