VB6 Simple Lock Program - Easily Secure Your Computer with a Password

In summary, the conversation was about creating a lock program in VB6, where the form is always on top and cannot be closed using the cross button. The form can still be resized, but the code for resizing to full screen using scalewidth and scaleheight options was not working. One solution suggested was to use the vbModal keyword and change the form properties to prevent any actions until the correct password is entered. The conversation also touched on preventing Alt+F4 and Ctrl+Alt+Del from closing the program, and the suggestion was made to consider moving on to VB.NET instead.
  • #1
madmike159
Gold Member
371
0
I made a simple lock program which is always ontop of other programs, I've removed all the controls from the form such as the cross button, it can only be closed by entering a password. The form can still be resized though so people can still use the computer. To get around this I tryed using the scalewidth and scalehigh options to resize it to full screen.

Code:
form1.scalewith = 11400
form1.scalehight = 15000

This is in a timer as a simple way rather than check it has been resized by the user. I can't get thecode to work though, even in something like a command button.

Can anyone work out where I'm going wrong?

thanks :biggrin:
 
Technology news on Phys.org
  • #2
madmike159 said:
I made a simple lock program which is always ontop of other programs, I've removed all the controls from the form such as the cross button, it can only be closed by entering a password. The form can still be resized though so people can still use the computer. To get around this I tryed using the scalewidth and scalehigh options to resize it to full screen.

Code:
form1.scalewith = 11400
form1.scalehight = 15000

This is in a timer as a simple way rather than check it has been resized by the user. I can't get thecode to work though, even in something like a command button.

Can anyone work out where I'm going wrong?

thanks :biggrin:

Just load the form with the vbModal keyword:

Code:
form1.Show vbModal

Then change the form properties as follows:

Code:
BorderSytle = Fixed Dialog
ControlBox = False
Moveable = False

This will create a pop-up form that will prevent them from doing anything until they enter the correct password. Of course the code for the correct password should unload the form as well as do whatever else you want it to.

Hope this helps.

CS
 
  • #3
so your saying that the program won't even shut down with the task manager or with
alt + f4?
 
  • #4
cam875 said:
so your saying that the program won't even shut down with the task manager or with
alt + f4?

No, I'm not. Perhaps I misread the OP's question. I assumed he meant all windows inside the VB application and not all windows (or applications) in the OS.

CS
 
  • #5
ive no idea what he meant now lol, but I guess he'll be the decider when he posts again.
 
  • #6
1st: madmike, why are you still using VB6?

2nd: stewartcs showed the solution. btw, to prevent Alt+F4 the KeyDown/KeyUp events should have an handler that cancels it. For the Ctrl+Alt+Del there's nothing you can do, unless you make your program a system service (Win 2k and above).
 
  • #7
as edsousa suggests, maybe it's time to move on from VB6. VB.NET is a lot nicer these days.
 

1. What is a VB6 simple lock program?

A VB6 simple lock program is a basic computer program created using Visual Basic 6 programming language that allows users to lock and unlock their computer or specific files and folders using a password. It is a security measure to prevent unauthorized access to sensitive information.

2. How does a VB6 simple lock program work?

The VB6 simple lock program works by prompting the user to enter a password when they want to lock their computer or specific files and folders. The program then encrypts the files and folders using the password and prevents access to them until the correct password is entered again.

3. Is a VB6 simple lock program secure?

While a VB6 simple lock program can provide basic security for personal computers, it may not be as secure as other advanced security measures. It is recommended to use additional security measures, such as firewalls and anti-virus software, to ensure the safety of sensitive information.

4. Can I change the password for a VB6 simple lock program?

Yes, you can change the password for a VB6 simple lock program by accessing the settings or preferences within the program. It is important to choose a strong, unique password to ensure the security of your locked files and folders.

5. Are there any alternatives to a VB6 simple lock program?

Yes, there are many other programs and software available that offer more advanced and secure locking options. Some popular alternatives include BitLocker for Windows computers and FileVault for Mac computers. It is important to research and choose a program that best fits your security needs.

Similar threads

  • Programming and Computer Science
Replies
2
Views
2K
  • Sticky
  • Aerospace Engineering
2
Replies
48
Views
60K
  • General Discussion
Replies
1
Views
8K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
8
Views
3K
Back
Top