|
При запуске данного кода вам будет предложено
набрать любую цифру от 1(быстрее) до 1000(медленнее),
которая характеризует скорость выпадания меню.
Внимание! После
применения данного кода возможна перезагрузка
машины, для того, чтобы новые данные вступили в
силу. Const EWX_REBOOT = 2
Const EWX_FORCE = 4
Private Declare Function ExitWindowsEx Lib "user32" (ByVal uFlags As Long, ByVal
dwReserved As Long) As Long
Private Declare Function RegCreateKey Lib "advapi32.dll" Alias
"RegCreateKeyA" (ByVal Hkey As Long, ByVal lpSubKey As String, phkResult As
Long) As Long
Private Declare Function RegCloseKey Lib "advapi32.dll" (ByVal Hkey As Long) As
Long
Private 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
Private 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
Const REG_SZ = 1
Const REG_DWORD = 4
Public Sub savestring(Hkey As Long, strPath As String, 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
Private Sub Command1_Click()
On Error GoTo Error
A% = InputBox("Наберите число от 1 до 1000",
"Скорость меню ПУСК")
If A% > 0 And A% < 1001 Then
B$ = CStr(A%)
'создание ключа MenuShowDelay в реестре
Call savestring(HKEY_CURRENT_USER, "Control Panel\Desktop",
"MenuShowDelay", B$)
'перезагрузка машины
MsgBox "Reset your Computer", , "Changes are made"
t& = ExitWindowsEx(EWX_FORCE Or EWX_REBOOT, 0)
Else
MsgBox "Not a valid number between 1 and 1000"
End If
Exit Sub
Error:
MsgBox "Invalid Data Input"
End Sub
|
|