Hi im trying to make a program that requires a password to unlock the desktop and ive tried loads of code to disable CTRL+ALT+DELETE but i think that it only disables Task Manager not Windows Serurity. Please could someone help me to disable the Windows Security screen. By the way im using Windows XP!
Im trying to make a program that basicly locks the pc but I cant seem to find some code that will disable CTRL+ALT+DELETE (Windows Security), I have only found code that will disable Task Manager!!
Why not just use the built in Windows Security? If you use the LockWorkstation API for NT based operating systems you can lock the workstation automatically. Then they need a password to unlock it.
VB Code:
Private Declare Function LockWorkStation Lib "user32.dll" () As Long
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
I don't really want to do that because my boss told me not to do that! When I say "Windows Security" I mean the form that comes up when you press CTRL+ALT+DELETE on a LAN domain! thanks anyway
I just got a great idea but im not sure if it will work! My idea is that if anybody could find out where the windows security exe or dll is situated and tell me I could then make a timer witch will delete it every milisecond and because its a windows file it should be replaced every 3 seconds!! Is it possible or not???
Ive found out where the DLL file is the path to it is "C:\WINDOWS\SYSTEM32\msgina.dll" but like you said you cant access it which you cant BUT I was wondering if somebody could come up with some API to see if its dialog was opened and if it is then it will hide it!!
If somebody could tell me a way to change what opens up when you press ctrl+alt+delete (eg. Change from Windows Security to Task Manager) I could do it to change from Windows Security to Task Manager you can use Control Panel, User Accounts, Change the way users log on or off and select "Use the Welcome Screen"!!! I would like it if someone could post the code to change that setting from VB6!!
They have written several different things which work together to replace the Windows security system - as it costs $299 for the program (not the code) it is safe to assume that even if you knew what you were doing it would take a long time (months/years) for you to write the equivalent.
I'm a little confused, why would you need to remove the Windows Security screen? If you want to lock the desktop from the user you can do that by creating a new desktop which only runs one single program, which would be your logon program. Doing this will not disable the Ctrl+Alt+Del screen however the user can not bring up the task manager so it can't close your program. Actually they can bring up the Task Manager but it will come up on the origional desktop and not the one you run your program on.
Attached is a sample that you can use. It contains two projects. The first called DesktopLaunch will create the new desktop and launch the second program on that desktop. The desktop will not be unloaded until the second program ends, and it will not end until the user has inputted the correct password (which is "secret", without the quotes in this sample).
To try out this you can load either the DesktopLaunch project or the Project Group (simply called Group1.vbg), however since the DesktopLaunch will run Login.exe (the second project) you must make sure you have compiled that first.
The DesktopLaunch project simply contains one class called CDesktop that takes care of everything related to creating a new desktop and launching one application on it, and unloads the desktop when this application ends. It also contains one regular module that has a Sub Main:
VB Code:
Public Sub Main()
Dim oDesktop As CDesktop
Set oDesktop = New CDesktop
With oDesktop
.Create "MySecurityDesktop"
.StartProcess App.Path & "\Login.exe"
.ClearUp
End With
Set oDesktop = Nothing
End Sub
The second project contains a simple Form with a textbox and a command button. The TextBox is where you would enter the password. The full code for this Form is as follows:
VB Code:
Private Sub cmdOK_Click()
If txtPwd.Text = "secret" Then
Unload Me
Else
MsgBox "Uncorrect password!", vbCritical
With txtPwd
.Text = ""
.SetFocus
End With
End If
End Sub
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
'Do only unload this Form if it was unloaded via code
If UnloadMode <> vbFormCode Then
Cancel = True
End If
End Sub
As you can see the code is very simple, all the advanced stuff is in the CDesktop class.
So when you've compiled both of these projects you should run the DesktopLaunch.exe program which launches your login.exe application. You can set this to run on startup of the computer.