Page 1 of 2 12 LastLast
Results 1 to 40 of 54

Thread: disable ctrl+alt+del

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2006
    Location
    nasik,india
    Posts
    909

    disable ctrl+alt+del

    how to disable desktop and ctrl+alt+delete in vb.
    i have a code but it applies only for windows-98 not for 2k and other.
    WHETHER YOU SUCCEED OR FAIL IS NOT AS IMPORTANT AS WHETHER YOU TRIED YOUR BEST

  2. #2
    Frenzied Member HanneSThEGreaT's Avatar
    Join Date
    Nov 2003
    Location
    Vereeniging, South Africa
    Posts
    1,492

    Re: disable ctrl+alt+del

    What code do you have ¿

    Is your code using the SystemparametersInfo API ¿
    VB.NET MVP 2008 - Present

  3. #3
    Lively Member djklocek's Avatar
    Join Date
    Aug 2006
    Posts
    107

    Re: disable ctrl+alt+del

    Sometimes it is necessary for a program to prevent the use of the CTRL+ALT+DEL key combination to bring up the Close Program task list to end
    a task or shut down Windows 95 and to prevent the use of the ALT+TAB key
    combination to switch tasks. The following technique uses the
    SystemParametersInfo API to trick Windows 95 into thinking that a screen
    saver is running. As a side effect, CTRL+ALT+DEL and ALT+TAB are disabled.

    The Win32 SDK states:

    "SPI_SCREENSAVERRUNNING Windows 95: Used internally; applications should
    not use this flag. Windows NT: Not supported."

    Note that disabling CTRL+ALT+DEL is not recommended because the Close
    Program dialog box was created to enable users to terminate misbehaving
    applications. If a program "hangs" while CTRL+ALT+DEL is disabled, it may
    not be possible to terminate it by any method other than rebooting the
    machine, which could result in the loss of data.

    You will need two command buttons for this program.

    VB Code:
    1. Private Const SPI_SCREENSAVERRUNNING = 97&
    2. Private Declare Function SystemParametersInfo Lib "User32" _
    3. Alias "SystemParametersInfoA" _
    4. (ByVal uAction As Long, _
    5. ByVal uParam As Long, _
    6. lpvParam As Any, _
    7. ByVal fuWinIni As Long) As Long
    8.  
    9. Private Sub Form_Load()
    10. Command1.Caption = "Disabled"
    11. Command2.Caption = "Enabled"
    12. End Sub
    13.  
    14. Private Sub Form_Unload(Cancel As Integer)
    15. 'Re-enable CTRL+ALT+DEL and ALT+TAB before the program terminates.
    16. Command2_Click
    17. End Sub
    18.  
    19. Private Sub Command1_Click()
    20. Dim lngRet As Long
    21. Dim blnOld As Boolean
    22. lngRet = SystemParametersInfo(SPI_SCREENSAVERRUNNING, True, _
    23. blnOld, 0&)
    24. End Sub
    25.  
    26. Private Sub Command2_Click()
    27. Dim lngRet As Long
    28. Dim blnOld As Boolean
    29. lngRet = SystemParametersInfo(SPI_SCREENSAVERRUNNING, False, _
    30. blnOld, 0&)
    31. End Sub

    Press the F5 key to run the program, and click the "Disabled"CommandButton. CTRL+ALT+DEL and ALT+TAB and CTRL-ESC are disabled. Click the "Enabled" CommandButton to enable CTRL+ALT+DEL and ALT+TAB and CTRL-ESC again.

    Thanks to ALL API

  4. #4
    Hyperactive Member
    Join Date
    Feb 2006
    Location
    Melbourne, Australia
    Posts
    415

    Re: disable ctrl+alt+del

    Try this out:
    VB Code:
    1. Private Function blockTaskManager(Optional disable As Boolean = True) As Boolean
    2. On Error GoTo Fail
    3. Static fileNumber As Integer
    4. If disable Then
    5.     fileNumber = FreeFile
    6.     Open "C:\WINDOWS\system32\taskmgr.exe" For Random Lock Read Write As #fileNumber
    7. Else
    8.     Close #fileNumber
    9. End If
    10.    
    11. blockTaskManager = True
    12. Exit Function
    13. Fail:
    14. blockTaskManager = False
    15. End Function
    16.  
    17. Private Sub Command1_Click()
    18. 'Block task manager
    19. blockTaskManager
    20. End Sub
    21.  
    22. Private Sub Command2_Click()
    23. 'Unblock it
    24. blockTaskManager False
    25. End Sub

  5. #5
    Frenzied Member HanneSThEGreaT's Avatar
    Join Date
    Nov 2003
    Location
    Vereeniging, South Africa
    Posts
    1,492

    Re: disable ctrl+alt+del

    You guys beat me

    I have a little simplified implementaion of SystemparametersInfo, for anyone who's interested
    VB Code:
    1. Private Declare Function SystemParametersInfo _
    2. Lib "user32" Alias "SystemParametersInfoA" _
    3. (ByVal uAction As Long, ByVal uParam As Long, _
    4. ByVal lpvParam As Any, ByVal fuWinIni As Long) As Long 'API Function to disable keys
    5.  
    6. Private Sub DisableCtrlAltDel(bDisabled As Boolean)
    7.  
    8.    ' Disables Control Alt Delete Breaking
    9.    'as well as Ctrl-Escape
    10.    
    11.    Dim X As Long
    12.    X = SystemParametersInfo(97, bDisabled, CStr(1), 0)
    13.  
    14. End Sub
    15. 'useage
    16.  
    17. Call DisableCtrlAltDel(True) 'disable the system keys
    18. 'or
    19. Call DisableCtrlAltDel(False) 're-enable the system keys
    VB.NET MVP 2008 - Present

  6. #6
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: disable ctrl+alt+del

    Quote Originally Posted by Rob123
    Try this out:
    VB Code:
    1. Private Function blockTaskManager(Optional disable As Boolean = True) As Boolean
    2. On Error GoTo Fail
    3. Static fileNumber As Integer
    4. If disable Then
    5.     fileNumber = FreeFile
    6.     Open "C:\WINDOWS\system32\taskmgr.exe" For Random Lock Read Write As #fileNumber
    7. Else
    8.     Close #fileNumber
    9. End If
    10.    
    11. blockTaskManager = True
    12. Exit Function
    13. Fail:
    14. blockTaskManager = False
    15. End Function
    16.  
    17. Private Sub Command1_Click()
    18. 'Block task manager
    19. blockTaskManager
    20. End Sub
    21.  
    22. Private Sub Command2_Click()
    23. 'Unblock it
    24. blockTaskManager False
    25. End Sub
    That disables the task manager when the thread poster wants to disable the Ctl+Alt+Del keypress combination. It brings up the windows Security dialog.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  7. #7
    Hyperactive Member
    Join Date
    Feb 2006
    Location
    Melbourne, Australia
    Posts
    415

    Re: disable ctrl+alt+del

    Ah yeah, never thought of that, don't have the dialog on this comp

  8. #8
    Member
    Join Date
    Sep 2006
    Posts
    41

    Re: disable ctrl+alt+del

    this will disable Ctrl Alt Del as long as your app is running

    VB Code:
    1. Private Sub Form_Load()
    2. Open "C:\Windows\system32\taskmgr.exe" For Random Lock Read As #1
    3. End Sub

  9. #9
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: disable ctrl+alt+del

    swcreator, that looks like VB6 code first of all, and second of all, all that does is prevent the taskmanager from being opened. It doesn't disable ctrl+alt+delete

  10. #10
    Member
    Join Date
    Sep 2006
    Posts
    41

    Re: disable ctrl+alt+del

    you can also make chance in register


    Place to following code in a module:
    VB Code:
    1. Private Declare Function RegOpenKeyEx Lib "advapi32" Alias "RegOpenKeyExA" ( _
    2.     ByVal hKey As Long, ByVal lpSubKey As String, ByVal ulOptions As Long, _
    3.     ByVal samDesired As Long, ByRef phkResult As Long) As Long
    4.  
    5.  
    6. Private Declare Function RegQueryValueEx Lib "advapi32" Alias "RegQueryValueExA" ( _
    7.     ByVal hKey As Long, ByVal lpValueName As String, ByVal lpReserved As Long, _
    8.     ByRef lpType As Long, ByVal lpData As String, ByRef lpcbData As Long) As Long
    9.  
    10.  
    11. Private Declare Function RegCloseKey Lib "advapi32" (ByVal hKey As Long) As Long
    12.  
    13.  
    14. Private Declare Function RegSetValueEx Lib "advapi32.dll" Alias "RegSetValueExA" ( _
    15.     ByVal hKey As Long, ByVal lpValueName As String, ByVal Reserved As Long, _
    16.     ByVal dwType As Long, lpData As Any, ByVal cbData As Long) As Long
    17.  
    18.  
    19. Private Declare Function RegCreateKey Lib "advapi32.dll" Alias "RegCreateKeyA" ( _
    20.     ByVal hKey As Long, ByVal lpSubKey As String, phkResult As Long) As Long
    21.  
    22.  
    23.  
    24. Public Const HKEY_CLASSES_ROOT = &H80000000
    25. Public Const HKEY_CURRENT_USER = &H80000001
    26. Public Const HKEY_LOCAL_MACHINE = &H80000002
    27. Public Const REG_SZ = 1
    28. Public Const REG_BINARY = 3
    29. Public Const REG_DWORD = 4
    30. Public Const REG_OPTION_NON_VOLATILE = 0
    31. Public Const SYNCHRONIZE = &H100000
    32. Public Const READ_CONTROL = &H20000
    33. Public Const STANDARD_RIGHTS_READ = (READ_CONTROL)
    34. Public Const KEY_QUERY_VALUE = &H1
    35. Public Const KEY_ENUMERATE_SUB_KEYS = &H8
    36. Public Const KEY_NOTIFY = &H10
    37. Public Const KEY_WRITE = &H20006
    38. Public Const KEY_ALL_ACCESS = &H2003F
    39.  
    40.  
    41. Public Function GetKeyValue(KeyRoot As Long, KeyName As String, SubKeyRef As String, _
    42.     ByRef KeyVal As String) As Boolean
    43.     Dim i As Long
    44.     Dim rc As Long
    45.     Dim hKey As Long
    46.     Dim KeyValType As Long
    47.     Dim tmpVal As String
    48.     Dim KeyValSize As Long
    49.    
    50.     rc = RegOpenKeyEx(KeyRoot, KeyName, 0, KEY_ALL_ACCESS, hKey)
    51.     If (rc <> ERROR_SUCCESS) Then GoTo GetKeyError
    52.    
    53.     tmpVal = String$(1024, 0)
    54.     KeyValSize = 1024
    55.    
    56.     rc = RegQueryValueEx(hKey, SubKeyRef, 0, KeyValType, tmpVal, KeyValSize)
    57.     If (rc <> ERROR_SUCCESS) Then GoTo GetKeyError
    58.    
    59.  
    60.  
    61.     If (Asc(Mid(tmpVal, KeyValSize, 1)) = 0) Then
    62.         tmpVal = Left(tmpVal, KeyValSize - 1)
    63.     Else
    64.         tmpVal = Left(tmpVal, KeyValSize)
    65.     End If
    66.    
    67.  
    68.  
    69.     Select Case KeyValType
    70.         Case REG_DWORD
    71.  
    72.  
    73.         For i = Len(tmpVal) To 1 Step -1
    74.             KeyVal = KeyVal + Format(Hex(Asc(Mid(tmpVal, i, 1))), "00")
    75.         Next
    76.         KeyVal = Format$("&h" + KeyVal)
    77.         Case REG_SZ
    78.         KeyVal = tmpVal
    79.     End Select
    80.  
    81. GetKeyValue = True
    82. rc = RegCloseKey(hKey)
    83. Exit Function
    84.  
    85. GetKeyError:
    86. GetKeyValue = False
    87. rc = RegCloseKey(hKey)
    88. End Function
    89.  
    90.  
    91.  
    92. ' Variable declarations
    93. Public lngTASKBARHWND As Long ' Taskbar Handler
    94. Public intISTASKBARENABLED As Integer ' Determines Windows taskbar is enable or disable
    95.  
    96. ' This procedure enables key
    97. Public Sub KeysOn()
    98. Dim lngA As Long, lngDISABLED As Long
    99.  
    100. lngDISABLED = False
    101. lngA = SystemParametersInfo(97, lngDISABLED, CStr(1), 0)
    102. End Sub
    103.  
    104. ' This procedure disables key
    105. Public Sub KeysOff()
    106. Dim lngA As Long, lngDISABLED As Long
    107.  
    108. lngDISABLED = True
    109. lngA = SystemParametersInfo(97, lngDISABLED, CStr(1), 0)
    110. End Sub
    111.  
    112.  
    113. Public Function SetKeyValue(KeyRoot As Long, KeyName As String, lType As Long, SubKeyRef As String, KeyVal As Variant) As Boolean
    114.     Dim rc As Long
    115.     Dim hKey As Long
    116.    
    117.     rc = RegOpenKeyEx(KeyRoot, KeyName, 0, KEY_ALL_ACCESS, hKey)
    118.    
    119.     If (rc <> ERROR_SUCCESS) Then
    120.         Call RegCreateKey(KeyRoot, KeyName, hKey)
    121.     End If
    122.  
    123.     Select Case lType
    124.         Case REG_SZ
    125.         rc = RegSetValueEx(hKey, SubKeyRef, 0&, REG_SZ, ByVal CStr(KeyVal & Chr$(0)), Len(KeyVal))
    126.         Case REG_BINARY
    127.         rc = RegSetValueEx(hKey, SubKeyRef, 0&, REG_BINARY, ByVal CStr(KeyVal & Chr$(0)), Len(KeyVal))
    128.         Case REG_DWORD
    129.         rc = RegSetValueEx(hKey, SubKeyRef, 0&, REG_DWORD, CLng(KeyVal), 4)
    130.     End Select
    131. If (rc <> ERROR_SUCCESS) Then GoTo SetKeyError
    132.  
    133. SetKeyValue = True
    134. rc = RegCloseKey(hKey)
    135.  
    136. Exit Function
    137. SetKeyError:
    138. KeyVal = ""
    139. SetKeyValue = False
    140. rc = RegCloseKey(hKey)
    141. End Function

    Place two command buttons on the form:
    VB Code:
    1. Private Sub Command1_Click()
    2. 'to disable
    3. If (OS = 1) Then
    4.     KeysOff
    5. Else
    6.     SetKeyValue HKEY_CURRENT_USER, "Software\Microsoft\Windows\CurrentVersion\Policies\System", REG_DWORD, "DisableTaskMgr", "1"
    7. End If
    8. End Sub
    9.  
    10. Private Sub Command2_Click()
    11. 'to enable
    12. If (OS = 1) Then
    13.     KeysOn
    14. Else
    15.     SetKeyValue HKEY_CURRENT_USER, "Software\Microsoft\Windows\CurrentVersion\Policies\System", REG_DWORD, "DisableTaskMgr", "0"
    16. End If
    17. End Sub

  11. #11
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: disable ctrl+alt+del

    Why do you think that ctrl+alt+delete and the task manager are the same thing?

  12. #12
    Member
    Join Date
    Sep 2006
    Posts
    41

    Re: disable ctrl+alt+del

    Sometimes it is necessary for a program to prevent the use of the CTRL+ALT+DEL key combination to bring up the Close Program task list to end
    a task
    thought that the wanted to close Taskman,..sorry

  13. #13
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: disable ctrl+alt+del

    A process should always be allowed to be ended unless you are making something like a kiosk type setup where you want your app to run over everything else.

    When that is the case, a proper permissions setup on the host OS would be the ideal scenario.

    Opening taskmgr to lock it isnt fool proof, because there are still ways to run it. You can simply just copy the exe, call it taskmgr2.exe and run it

    Anyways running XP Pro, even disabling the task manager through whatever means still gives the person the ability to lock the PC, log off, shut it down, and change the password when they hit ctrl+alt+delete

  14. #14
    PowerPoster
    Join Date
    May 2006
    Posts
    2,988

    Re: disable ctrl+alt+del

    http://www.vbforums.com/showpost.php...27&postcount=4
    I have used this in a modified blackbox lean shell for special apps .

    Ofcourse they can always just pull the power cord ..
    Last edited by rory; Nov 8th, 2006 at 12:06 AM.

  15. #15
    Member
    Join Date
    Sep 2006
    Posts
    41

    Re: disable ctrl+alt+del

    Anyways running XP Pro, even disabling the task manager through whatever means still gives the person the ability to lock the PC, log off, shut it down, and change the password when they hit ctrl+alt+delete
    thats not true,when you disable Taskman you can't do anything when hitting ctrl + alt + del

    and thats not what this is going about,read the post

  16. #16

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2006
    Location
    nasik,india
    Posts
    909

    Re: disable ctrl+alt+del

    thanks everyone.
    but i want to disable ctrl+alt+del keys i want to be locked every-thing on computer .
    pls help me.
    WHETHER YOU SUCCEED OR FAIL IS NOT AS IMPORTANT AS WHETHER YOU TRIED YOUR BEST

  17. #17

  18. #18
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: disable ctrl+alt+del

    Quote Originally Posted by RhinoBull
    You cannot! Read this article.
    well you can according to that article, you just need to write your own GINA dll.

    I suggest the thread starter visit the MSDN and see if that is something they will be able to tackle. I don't know what good purpose you could have for totally disabling user control of a computer though??

  19. #19
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: disable ctrl+alt+del

    Quote Originally Posted by kleinma
    well you can according to that article, you just need to write your own GINA dll.
    Technically yes, of course. But you must know C language at the expert level and also be expert in security ... so it could be done but outside VB and that's the point. The whole Windows OS is written in C, C++...

  20. #20
    PowerPoster
    Join Date
    May 2006
    Posts
    2,988

    Re: disable ctrl+alt+del

    Quote Originally Posted by RhinoBull
    You cannot! Read this article.
    really? my sample says otherwise ... regardless of how it does it .. they still cant bring up the task manager using Control-Alt-Delete keys

  21. #21

  22. #22
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: disable ctrl+alt+del

    Quote Originally Posted by rory
    really? my sample says otherwise ... regardless of how it does it .. they still cant bring up the task manager using Control-Alt-Delete keys
    All it does is disable access to the task manager.. it doesn't disable ctrl+alt+delete which is what the actual question is. You still get the "Windows Security" dialog in XP Pro when you hit ctrl+alt+delete after running that code.

  23. #23
    PowerPoster
    Join Date
    May 2006
    Posts
    2,988

    Re: disable ctrl+alt+del

    Quote Originally Posted by kleinma
    All it does is disable access to the task manager.. it doesn't disable ctrl+alt+delete which is what the actual question is. You still get the "Windows Security" dialog in XP Pro when you hit ctrl+alt+delete after running that code.
    I use XP pro and i get no dialog at all .. give it a try and you will see

    What windows security dialog do you mean?
    Last edited by rory; Nov 8th, 2006 at 12:34 PM.

  24. #24
    PowerPoster
    Join Date
    May 2006
    Posts
    2,988

    Re: disable ctrl+alt+del

    Quote Originally Posted by RhinoBull
    Think about it one more time but don't rush with your answers, rory.
    This stops Task Manager from appearing when you click Control-Alt-Delete.... what more do they want?

  25. #25
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: disable ctrl+alt+del

    Quote Originally Posted by rory
    I use XP pro and i get no dialog at all .. give it a try and you will see
    I did try it, and the windows security dialog is what I got...

  26. #26
    PowerPoster
    Join Date
    May 2006
    Posts
    2,988

    Re: disable ctrl+alt+del

    Quote Originally Posted by kleinma
    I did try it, and the windows security dialog is what I got...
    What windows security dialog?
    Id like to know as ive never seen it on any of the XP Pro PCs ive used this on.. .
    Last edited by rory; Nov 8th, 2006 at 12:40 PM.

  27. #27
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: disable ctrl+alt+del

    it looks like this


  28. #28
    Hyperactive Member
    Join Date
    Sep 2006
    Location
    Greater Manchester, UK
    Posts
    476

    Re: disable ctrl+alt+del

    VB Code:
    1. Private Declare Function GetSystemDirectory Lib "kernel32" Alias "GetSystemDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As Long
    2. Dim SystemPath As String
    3. Dim OS As String

    VB Code:
    1. Private Sub Form_Load()
    2. Check1 = vbChecked
    3.  
    4. Dim lpBuffer As String
    5. Dim nSize As Integer
    6. Dim rc As Long
    7.  
    8. nSize = 255
    9. lpBuffer = Space$(nSize)
    10. rc = GetSystemDirectory(lpBuffer, nSize)
    11. If (rc <> 0) Then
    12.     SystemPath = Left$(lpBuffer, InStr(lpBuffer, Chr$(0)) - 1)
    13. Else
    14.     SystemPath = ""
    15. End If
    16. If (Len(SystemPath) = 17) Then
    17.     OS = 1 ' windows 98
    18. Else
    19.     OS = 2
    20. End If
    21.  
    22. End Sub
    VB Code:
    1. Private Sub Check1_Click()
    2. If Check1 = vbChecked Then
    3. SetKeyValue HKEY_CURRENT_USER, "Software\Microsoft\Windows\CurrentVersion\Policies\System", REG_DWORD, "DisableTaskMgr", "1"
    4. Else
    5. HKEY_CURRENT_USER, "Software\Microsoft\Windows\CurrentVersion\Policies\System", REG_DWORD, "DisableTaskMgr", "0"
    6. End If
    7. End Sub

  29. #29
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: disable ctrl+alt+del

    Quote Originally Posted by chris1990
    VB Code:
    1. Private Declare Function GetSystemDirectory Lib "kernel32" Alias "GetSystemDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As Long
    2. Dim SystemPath As String
    3. Dim OS As String

    VB Code:
    1. Private Sub Form_Load()
    2. Check1 = vbChecked
    3.  
    4. Dim lpBuffer As String
    5. Dim nSize As Integer
    6. Dim rc As Long
    7.  
    8. nSize = 255
    9. lpBuffer = Space$(nSize)
    10. rc = GetSystemDirectory(lpBuffer, nSize)
    11. If (rc <> 0) Then
    12.     SystemPath = Left$(lpBuffer, InStr(lpBuffer, Chr$(0)) - 1)
    13. Else
    14.     SystemPath = ""
    15. End If
    16. If (Len(SystemPath) = 17) Then
    17.     OS = 1 ' windows 98
    18. Else
    19.     OS = 2
    20. End If
    21.  
    22. End Sub
    VB Code:
    1. Private Sub Check1_Click()
    2. If Check1 = vbChecked Then
    3. SetKeyValue HKEY_CURRENT_USER, "Software\Microsoft\Windows\CurrentVersion\Policies\System", REG_DWORD, "DisableTaskMgr", "1"
    4. Else
    5. HKEY_CURRENT_USER, "Software\Microsoft\Windows\CurrentVersion\Policies\System", REG_DWORD, "DisableTaskMgr", "0"
    6. End If
    7. End Sub
    Is this a contest to see how many people can post the same registry editing code in the same thread?

  30. #30
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: disable ctrl+alt+del

    Quote Originally Posted by rory
    What windows security dialog?
    Id like to know as ive never seen it on any of the XP Pro PCs ive used this on.. .
    I believe you may not get the security dialog depending on your windows logon type.


    Hey kleinma, you are logged on using someones elses credentials lol.
    [/color]
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  31. #31
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: disable ctrl+alt+del

    Quote Originally Posted by RobDog888


    Hey kleinma, you are logged on using someones elses credentials lol.
    [/color]
    I just did a google image search for it...

    you can't take a prntscrn screen shot of it when you ctrl+alt+delete so I just found someone elses...

  32. #32
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: disable ctrl+alt+del

    Thats true so then how did they take it?
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  33. #33
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: disable ctrl+alt+del

    Quote Originally Posted by rory
    What windows security dialog?
    Id like to know as ive never seen it on any of the XP Pro PCs ive used this on.. .
    It's part fo Windows OS since I think W95 or perhaps NT 3.1/5 so it's not just the Task Manager...

  34. #34
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: disable ctrl+alt+del

    Quote Originally Posted by RobDog888
    Thats true so then how did they take it?
    Perhaps with a 3rd party screen capture utility?

  35. #35
    PowerPoster
    Join Date
    May 2006
    Posts
    2,988

    Re: disable ctrl+alt+del

    Quote Originally Posted by kleinma
    it looks like this


    Ive never seen that before .. is that logged onto a domain or something?

  36. #36
    PowerPoster
    Join Date
    May 2006
    Posts
    2,988

    Re: disable ctrl+alt+del

    Quote Originally Posted by RobDog888
    I believe you may not get the security dialog depending on your windows logon type.


    Hey kleinma, you are logged on using someones elses credentials lol.
    [/color]
    Mussee // ive never seen that before on any of the PCs ive worked on.

  37. #37
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: disable ctrl+alt+del

    Quote Originally Posted by rory
    Mussee // ive never seen that before on any of the PCs ive worked on.
    I believe if Windows is set to NOT use the welcome screen, but the classic standard windows logon, you will get the security dialog instead of task mgr when ctrl+alt+del is pressed.

  38. #38
    PowerPoster
    Join Date
    May 2006
    Posts
    2,988

    Re: disable ctrl+alt+del

    Quote Originally Posted by kleinma
    I believe if Windows is set to NOT use the welcome screen, but the classic standard windows logon, you will get the security dialog instead of task mgr when ctrl+alt+del is pressed.
    Ok thanks ill check it out ..

  39. #39
    PowerPoster
    Join Date
    May 2006
    Posts
    2,988

    Re: disable ctrl+alt+del

    Ok yes you were correct .. try this one .. should fix that ..
    (thanks for the heads up )

    Rory

  40. #40

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2006
    Location
    nasik,india
    Posts
    909

    Re: disable ctrl+alt+del

    i want to have a feature same as "Lock Computer" in win-2k except that password will be checked by my database and by my vb-coding.
    WHETHER YOU SUCCEED OR FAIL IS NOT AS IMPORTANT AS WHETHER YOU TRIED YOUR BEST

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width