Merubah Speed dari Windows Start Menu
Saturday, January 19th, 2008Untuk melakukannya kita membuat string baru pada windows registry dengan nama MenuShowDelay dengan nilai antara 1 s/d 1000, pada lokasi HKEY_CURRENT_USER\Control Panel\Desktop
Pada module ketikan kode berikut ini:
Public Const EWX_FORCE = 4
uFlags As Long, ByVal dwReserved As Long) As Long
“RegCreateKeyA” (ByVal Hkey As Long, ByVal lpSubKey As _
String, phkResult As Long) As Long
Declare Function RegCloseKey Lib “advapi32.dll” (ByVal _
Hkey As Long) As Long
Declare Function RegQueryValueEx Lib “advapi32.dll” Alias _
“RegQueryValueExA” (ByVal Hkey As Long, ByVal lpValueName _
As String, ByVal lpReserved As Long, lpType As Long, _
lpData As Any, lpcbData As Long) As Long
Declare Function RegSetValueEx Lib “advapi32.dll” Alias _
“RegSetValueExA” (ByVal Hkey As Long, ByVal lpValueName _
As String, ByVal Reserved As Long, ByVal dwType As Long, _
lpData As Any, ByVal cbData As Long) As Long
Public Const REG_SZ = 1
Public Const REG_DWORD = 4
strValue As String, strdata As String)
Dim keyhand
Dim r
r = RegCreateKey(Hkey, strPath, keyhand)
r = RegSetValueEx(keyhand, strValue, 0, REG_SZ, ByVal _
strdata, Len(strdata))
r = RegCloseKey(keyhand)
End Sub
Taruh 2 command buttons dan masukan kode berikut ini:
On Error GoTo error
a% = InputBox(”Enter a number between 1 and 1000″, _
“Start Menu Speed”)
‘input is a valid number between 1 and 1000
‘and a (integer) is to be converted in b (string)
‘(if allready exists it just changes the value)
Call savestring(HKEY_CURRENT_USER, _
“Control Panel\Desktop”, “MenuShowDelay”, b$)
‘resetting computer
t& = ExitWindowsEx(EWX_FORCE Or EWX_REBOOT, 0)
Else
MsgBox “Not a valid number between 1 and 1000″
End If
Exit Sub
error:
‘error, input was not a valid number
MsgBox “Invalid Data Input”
End Sub
Unload Me
End Sub