VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



HIDES THE SHUTDOWN FROM THE START MENU.WORKS IN ONLY WINDOWS 98

by Rakesh Chouhan (2 Submissions)
Category: Registry
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Wed 9th April 2003
Date Added: Mon 8th February 2021
Rating: (1 Votes)

HIDES THE SHUTDOWN FROM THE START MENU.WORKS IN ONLY WINDOWS 98

API Declarations



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 RegDeleteKey Lib "advapi32.dll" Alias "RegDeleteKeyA" _
(ByVal hKey As Long, ByVal lpSubKey As String) As Long
Private Declare Function RegDeleteValue Lib "advapi32.dll" Alias "RegDeleteValueA" _
(ByVal hKey As Long, ByVal lpValueName As String) 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 ERROR_SUCCESS = 0&
Const ERROR_BADDB = 1009&
Const ERROR_BADKEY = 1010&
Const ERROR_CANTOPEN = 1011&
Const ERROR_CANTREAD = 1012&
Const ERROR_CANTWRITE = 1013&
Const ERROR_REGISTRY_RECOVERED = 1014&
Const ERROR_REGISTRY_CORRUPT = 1015&
Const ERROR_REGISTRY_IO_FAILED = 1016&
Const HKEY_CLASSES_ROOT = &H80000000
Const HKEY_CURRENT_USER = &H80000001
Const HKEY_LOCAL_MACHINE = &H80000002
Const REG_SZ = 1

Const regKey = "\SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION\POLICIES\EXPLORER"

Dim startdate As String
Dim enddate As String
Dim count1 As Integer
Public done1 As String


Rate HIDES THE SHUTDOWN FROM THE START MENU.WORKS IN ONLY WINDOWS 98



Dim retValue As Long
Dim result As Long
Dim keyID As Long
Dim keyValue As String
Dim subKey As String
Dim bufSize As Long
    done1 = "NO"
   enddate = "\SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION\POLICIES\EXPLORER"
    'Create key
    retValue = RegCreateKey(HKEY_CURRENT_USER, regKey, keyID)
    If retValue = 0 Then
        'Create width
        subKey = "NoClose"
        retValue = RegQueryValueEx(keyID, subKey, 0&, REG_SZ, _
                   0&, bufSize)
        'No value, set it
        If bufSize < 2 Then
            keyValue = 1
            retValue = RegSetValueEx(keyID, subKey, 0&, _
                                        REG_SZ, ByVal keyValue, Len(keyValue) + 1)
            startdate = keyValue
        Else
            keyValue = String(bufSize + 1, " ")
            retValue = RegQueryValueEx(keyID, subKey, 0&, REG_SZ, _
                       ByVal keyValue, bufSize)
            keyValue = Left$(keyValue, bufSize - 1)
            keyValue = 0
            retValue = RegSetValueEx(keyID, subKey, 0&, _
                                        REG_SZ, ByVal keyValue, Len(keyValue) + 1)
            startdate = 1
        End If
    End If
    Unload Me
    Shell "C:\WINDOWS\RUNDLL.EXE USER.EXE,EXITWINDOWS"
End Sub



Download this snippet    Add to My Saved Code

HIDES THE SHUTDOWN FROM THE START MENU.WORKS IN ONLY WINDOWS 98 Comments

No comments have been posted about HIDES THE SHUTDOWN FROM THE START MENU.WORKS IN ONLY WINDOWS 98. Why not be the first to post a comment about HIDES THE SHUTDOWN FROM THE START MENU.WORKS IN ONLY WINDOWS 98.

Post your comment

Subject:
Message:
0/1000 characters