Solved

How to disable Alt-Tab, Ctrl-Esc and Ctrl-Alt-Del using VB under Win NT environment ?

Posted on 2000-03-08
3
456 Views
Last Modified: 2008-02-26
I want to disable Alt-Tab, Ctrl-Esc and Ctrl-Alt-Del while my application is running in Win NT4.0 environment. I only know VB. Can someone give me a solution, it could be in C.
0
Comment
Question by:johnlys
3 Comments
 
LVL 1

Expert Comment

by:olgat
ID: 2595446
Try the following entry in the registry.
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon]
"DisableCtrlAltDel"="0"





0
 

Accepted Solution

by:
canUCme earned 50 total points
ID: 2595451
Here's code(see no C/C++ at all) all in vb( even I hate VB!)..
copy these to your program

Declarations to general
/-clip--/clip--/clip/-clip--/clip--/clip

Private Declare Function SystemParametersInfo Lib "user32" Alias _
"SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam _
As Long, ByVal lpvParam As Any, ByVal fuWinIni As Long) As Long
/-clip--/clip--/clip/-clip--/clip--/clip

Sub rutines needed
/-clip--/clip--/clip/-clip--/clip--/clip

'This disables/enables ctrl-alt-delete and ctrl-esc

Sub DisableKeys(bDisabled As Boolean)
        Dim X As Long
        X = SystemParametersInfo(97, bDisabled, CStr(1), 0)
End Sub

' This disables/enables ALT - <TAB>

FastTaskSwitching(bEnabled As Boolean)
  Dim X As Long, bDisabled As Long

  bDisabled = Not bEnabled
  X = SystemParametersInfo(97, bDisabled, CStr(1), 0)
End Sub

/-clip--/clip--/clip/-clip--/clip--/clip
Call sub from yout prorgram like this
to disable ctrl-alt-del ctrl-esc and alt - tab

Call DisableKeys(True)
call FastTaskSwitching(True)

to enable ctrl-alt-del ctrl-esc and alt - tab

Call DisableKeys(False)
call FastTaskSwitching(False)




0
 
LVL 7

Expert Comment

by:KangaRoo
ID: 2595452
>> Win NT4.0
Too bad, in Win95, 98 and NT5 you could use

BOOL SystemParametersInfo(SPI_SETSCREENSAVERRUNNING,
                                UINT newval,
                                LPVOID &oldval,
                                0);
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question