By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,986 Members | 2,042 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,986 IT Pros & Developers. It's quick & easy.

Automatic Lock

werks
100+
P: 220
Hi there programmers does does anyone know how to lock the screen? i mean when you click the Lock Button everything in the desktop will be LOCK unless you input the correct password to unlock it..pls help..

Thanks in advance


Better Than Yesterday ^^
Jan 29 '08 #1
Share this Question
Share on Google+
26 Replies


daniel aristidou
100+
P: 491
Hi there programmers does does anyone know how to lock the screen? i mean when you click the Lock Button everything in the desktop will be LOCK unless you input the correct password to unlock it..pls help..

Thanks in advance


Better Than Yesterday ^^
Well im not sure how effective the method i suggest will be.......
//Think it may be overidable using Ctrl+Alt+Del
This might me avoided(maybe) By adding keypress events....//

Make a form..
SEt on top = True (i think this is nnot available in vb6)
Make it without border
Add a picture frame
Set its position to x= 0 y =O
On click enter code to
CApture the screen.....
Paste in picture box
Make form modal
Maximize the form.....

Then add textbox tothe form....(on top of picture)
Use this for password ....
Jan 29 '08 #2

werks
100+
P: 220
Hi tnx for the reply. I want my system to lock everything even the START Program. the user could'nt also use the ALT+TAB.
Jan 29 '08 #3

daniel aristidou
100+
P: 491
Hi tnx for the reply. I want my system to lock everything even the START Program. the user could'nt also use the ALT+TAB.
By startprograsm u mean the menu bar?
It locks this as well . thinkk
Jan 29 '08 #4

daniel aristidou
100+
P: 491
By startprograsm u mean the menu bar?
It locks this as well . thinkk
Try add ing a the keydown events or keypress
When Alt + tab...... me.show modally
When ctrl+ Alt + del me. show modally
Jan 29 '08 #5

werks
100+
P: 220
tnx.. i'll try this later


Better Than Yesterday ^^
Jan 29 '08 #6

werks
100+
P: 220
Hello does anyone know how to lock the system within a specified time? Like a screensaver..

Actually i want my system to automatically lock if it is unused for about 15 minutes..tnx in advanced


Better Than Yesterday ^^
Feb 5 '08 #7

P: 11
You can use the Shell() function to run windows commands, so if you wanted to lock the computer you could try a command like

Expand|Select|Wrap|Line Numbers
  1.         Shell("rundll32.exe user32.dll, LockWorkStation")
  2.  
Wagz
Feb 6 '08 #8

Expert 5K+
P: 8,434
Hello does anyone know how to lock the system within a specified time? Like a screensaver..

Actually i want my system to automatically lock if it is unused for about 15 minutes..tnx in advanced
That would depend on what you mean by "the system". If you mean your application, then you just use a timer in your program and reset something each time the user does anything.

If you mean "the system" as in the entire Windows session, just turn on your screensaver.
Feb 6 '08 #9

debasisdas
Expert 5K+
P: 8,127
Actually i want my system to automatically lock if it is unused for about 15 minutes............
Why are you trying to re-invent the wheel .
Feb 6 '08 #10

Ali Rizwan
100+
P: 927
Hello does anyone know how to lock the system within a specified time? Like a screensaver..

Actually i want my system to automatically lock if it is unused for about 15 minutes..tnx in advanced


Better Than Yesterday ^^
I have made a programe in vb6 which switches the computer to login screen after a specific time or locks the computer.
And another which locks your whole computer screen.
Which of them you need tell me i ll send you that code or the whole programe.

Regards
>> ALI <<
Feb 6 '08 #11

werks
100+
P: 220
You can use the Shell() function to run windows commands, so if you wanted to lock the computer you could try a command like

Expand|Select|Wrap|Line Numbers
  1.         Shell("rundll32.exe user32.dll, LockWorkStation")
  2.  
Wagz

thanks for the code..and it works..
Feb 6 '08 #12

werks
100+
P: 220
Thank you for the reply.. I'll be locking the whole computer screen and the user will return to the login screen of the computer..

Now my another problem is that how can i locked it if it is unused in a specified time ^^

Tnanks
Feb 6 '08 #13

chandru8
100+
P: 145
can you please post that code
Feb 6 '08 #14

QVeen72
Expert 100+
P: 1,445
Hi,

Place a Timer on the Form..Enable it and Set Interval to 1000
Decalre a FormLevel variable say TempIdle As Integer

Make TempIdle = 0 In MouseMove and KeyPress Events of the Form.

In Timer1_Timer Event :
Expand|Select|Wrap|Line Numbers
  1. TempIdle = TempIdle +1
  2. If TempIdle>= 300 Then ' 5 mins
  3.   TempIdle = 0 
  4.   Timer1.Enabled = False
  5.   ' / Write code to Lock the system..
  6. End  If
  7.  
And In Form_Activate event:
Timer1.Enabled = True
'This is for Tracking time again after Re-logging..

Regards
Veena
Feb 6 '08 #15

chandru8
100+
P: 145
Thanks for your reply i need the code to lock the system
thanks ya..,
Feb 6 '08 #16

QVeen72
Expert 100+
P: 1,445
Hi Chandru,

Read this complete thread, you will get it in second post..

Regards
Veena
Feb 6 '08 #17

Ali Rizwan
100+
P: 927
Hi all,

Here is my Auto Locker.

It hides itself from task manager's processes.
Auto Startup function.

If any errors or problems contact me.

Regards

>> ALI <<
Attached Files
File Type: zip Sys Lock.zip (51.3 KB, 363 views)
Feb 6 '08 #18

werks
100+
P: 220
Hi all,

Here is my Auto Locker.

It hides itself from task manager's processes.
Auto Startup function.

If any errors or problems contact me.

Regards

>> ALI <<
Errors occurred


Runtime Error '380'

Invalid Property Value


Is there something wrong?
Feb 7 '08 #19

werks
100+
P: 220
Thank you for helping me programmers..

Better Than Yesterday ^^
Feb 7 '08 #20

Ali Rizwan
100+
P: 927
Thank you for helping me programmers..

Better Than Yesterday ^^
OK i have found the error i ll fix the bug and upload again.

Regards
>> ALI <<
Feb 7 '08 #21

Ali Rizwan
100+
P: 927
I have made a Screen Lock which locks every thing open in a hidden mode. No one can use your computer without permission.
If you need that Screen Lock application you can contact me.

Regards
>> ALI <<
Feb 7 '08 #22

werks
100+
P: 220
I have made a Screen Lock which locks every thing open in a hidden mode. No one can use your computer without permission.
If you need that Screen Lock application you can contact me.

Regards
>> ALI <<
Could you upload it..tnx Ali
Feb 7 '08 #23

Ali Rizwan
100+
P: 927
Could you upload it..tnx Ali
The error was with Progress Bar. It was not updated automatically with change of time and on startup.
Ok put your task bar on top of screen i mean place the task bar on the top and then run the application.

Or set your task bar to auto hide.

Thanks.

Regards
>> ALI <<
Attached Files
File Type: zip Sys Lock (Final).zip (51.8 KB, 340 views)
Feb 7 '08 #24

werks
100+
P: 220
tnx Ali Rizwan.. it works great and nice interface with transaparency..
Feb 7 '08 #25

Ali Rizwan
100+
P: 927
tnx Ali Rizwan.. it works great and nice interface with transaparency..
Do you know the password??
Its asd

Regards
>> ALI <<
Feb 11 '08 #26

werks
100+
P: 220
Do you know the password??
Its asd

Regards
>> ALI <<

Thanks Ali..


Better Than Yesterday ^^
Feb 11 '08 #27

Post your reply

Sign in to post your reply or Sign up for a free account.