I want to know how to make a screen locker using VB6. I have tried maximizing the frame but it still can be minimized. Then I have made the frame very large to fit the entire screen and made the frame irresizeable but someone can press Alt+F4 and close it. I also want the task manager to be disabled. So can anyone please help me?
Asked
Active
Viewed 2,612 times
-2
-
3What do you mean "make a screen locker"? Are you trying to have a form that can't be closed or lost focus, and Task Manager can't be accessed? That's a horrible idea. Or do you simply want to mimic the Windows-L key and lock the computer? – LittleBobbyTables - Au Revoir Sep 21 '12 at 17:46
-
You need to look into COM (I am assuming you are using windows) ... you are way off track in how you are going about this. You are going to have to hook the OS. http://www.codeproject.com/Articles/633/Introduction-to-COM-What-It-Is-and-How-to-Use-It – David Sep 21 '12 at 17:48
3 Answers
5
This is probably not what you are trying to do but, you can lock windows by calling the WINAPI function LockWorkStation.
Option Explicit
Private Declare Function LockWorkStation Lib "User32" () As Boolean
Call it with
Call LockWorkStation
If you put the declare statement in a .bas module and call it from a form you will want to change the declare scope to Public. This function is supported in Windows XP and up, and Windows Server 2003 and up.
2
There is no absolute way to completely prevent the application from stopping. And can we know why you would do that?
Still, you can prevent the user from closing the application with the cancel parameter.
private sub Form_unload(Cancel as Integer)
Cancel = 1
End Sub

dan
- 3,439
- 17
- 54
- 82
1
You can remove the exit button and make the form immovable and irresizeable. The you can call a batch file that will stop the task manager as :
:run
taskkill /f /im taskmgr.exe
goto run
This will continuously stop the task manager if it is opened.

Arghya Chakraborty
- 433
- 1
- 3
- 12
-
1
-
What about just powering the machine off without closing anything or shutting down Windows? Not sure what Site Helpers is up to, but sounds like a particularly bad design. – jac Sep 24 '12 at 20:36