0

hello everybody !!!!!!!!!!

I have a code which i coded but in that their is an error

to lock the screen

in the form1 i have written

msgbox("we are about to lock your screen!!!")
me.visible=false
lockscreen.visible=true
lockscreen.killprocess.enabled=true

            'the code i had written in the timer is

public sub killprocess(byval processTokill)
dim proc() As process= Process.GetProcess
for I as Integer =0 To porc.GetUpperBound(0)
If proc(I).processname="Explorer" then
proc(I).kill()
endif
next
endsub

still the code is not getting preferred output

were lockscreen is the name of the form1

in the form2 the password should be entered
in the form2 the code is

'in button
if passwordbox.text="topsecret" then
process.start("explorer")
end
else
endif
3
Contributors
2
Replies
3
Views
5 Years
Discussion Span
Last Post by adam_k
1

You have a typo in the for loop. You mistyped "proc" as "porc".

As far as I know, you can't lock the screen by killing explorer.exe. It can always be started again from task manager (which can be activated from the keyboard). However, you CAN lock the workstation by executing the following command

rundll32 user32.dll,LockWorkStation

The password to unlock it will be the password used at logon.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.