|
-
Jun 20th, 2009, 12:07 PM
#1
Thread Starter
Lively Member
lock windows
hi
i have a program that starts up when you start the pc
this program needs to be able to use the scaner but i want it disable evry button ... of windows
is this posible?
thanx in advance!
MrSmither
ps: i thought of stoping explorer.exe but i figured my program would disappear too
he is a good friend that speaks well of us behind our backs
-
Jun 20th, 2009, 12:12 PM
#2
Re: lock windows
Disable every button in windows? What do you mean? Disable every window on the desktop? If so, why would you need to do that? Please be more specific and explain why.
-
Jun 20th, 2009, 12:15 PM
#3
Thread Starter
Lively Member
Re: lock windows
well i what to block the user from dooing anything
this is a password program
he is a good friend that speaks well of us behind our backs
-
Jun 20th, 2009, 01:57 PM
#4
Re: lock windows
You can easily stop them from doing anything else in your program by opening your password form vbModal. Why would you want to do more than that?
-
Jun 20th, 2009, 04:27 PM
#5
Thread Starter
Lively Member
Re: lock windows
whats vbmodel?
can it block the user from doing anything outside my program?
thanx
he is a good friend that speaks well of us behind our backs
-
Jun 20th, 2009, 06:55 PM
#6
Re: lock windows
Form1.Show vbModal
When used on one of your forms no other of your forms can be accessed until the vbModal form is closed. Again, why do you care about any other programs?
-
Jun 21st, 2009, 04:14 PM
#7
Thread Starter
Lively Member
Re: lock windows
o.k.
thanx
i have seen that you can confine the mouse tho the form...
my ? is can i stop the mouse from leaving the fiscal edge of the form i.e. if it arrives at the edge, it stops!
tahnx in advance
MrSmither
he is a good friend that speaks well of us behind our backs
-
Jun 21st, 2009, 05:18 PM
#8
Re: lock windows
Here's an example from the API Guide that uses the ClipCursor API do do that.
Code:
Private Type RECT
left As Long
top As Long
right As Long
bottom As Long
End Type
Private Type POINT
x As Long
y As Long
End Type
Private Declare Sub ClipCursor Lib "user32" (lpRect As Any)
Private Declare Sub GetClientRect Lib "user32" (ByVal hWnd As Long, lpRect As RECT)
Private Declare Sub ClientToScreen Lib "user32" (ByVal hWnd As Long, lpPoint As POINT)
Private Declare Sub OffsetRect Lib "user32" (lpRect As RECT, ByVal x As Long, ByVal y As Long)
Private Sub Form_Load()
'KPD-Team 1999
'URL: http://www.allapi.net/
'E-Mail: [email protected]
Command1.Caption = "Limit Cursor Movement"
Command2.Caption = "Release Limit"
End Sub
Private Sub Command1_Click()
'Limits the Cursor movement to within the form.
Dim client As RECT
Dim upperleft As POINT
'Get information about our wndow
GetClientRect Me.hWnd, client
upperleft.x = client.left
upperleft.y = client.top
'Convert window coördinates to screen coördinates
ClientToScreen Me.hWnd, upperleft
'move our rectangle
OffsetRect client, upperleft.x, upperleft.y
'limit the cursor movement
ClipCursor client
End Sub
Private Sub Command2_Click()
'Releases the cursor limits
ClipCursor ByVal 0&
End Sub
Private Sub Form_Unload(Cancel As Integer)
'Releases the cursor limits
ClipCursor ByVal 0&
End Sub
-
Jun 22nd, 2009, 01:21 AM
#9
Re: lock windows
 Originally Posted by mr smither
o.k.
thanx
i have seen that you can confine the mouse tho the form...
my ? is can i stop the mouse from leaving the fiscal edge of the form i.e. if it arrives at the edge, it stops!
tahnx in advance
MrSmither
If you are trying to prevent users from using the mouse to access any other windows, then that could do it. But they will still be able to use the keyboard to maneuver around, including Ctrl+Alt+Del to access task manager and shut your app down so they can get their mouse back -- that's what I'd do.
-
Jun 22nd, 2009, 03:16 AM
#10
Re: lock windows
 Originally Posted by LaVolpe
If you are trying to prevent users from using the mouse to access any other windows, then that could do it. But they will still be able to use the keyboard to maneuver around, including Ctrl+Alt+Del to access task manager and shut your app down so they can get their mouse back -- that's what I'd do.
that's also stoppable with a keyboard hook. There's code samples on the forum. But (especially if you are using a twain device) if for some reason it locks your program up, the user will have to reset the computer.
Why you would want your program to access their scanner is beyond me, unless it's a scanning program. In that case, you'd be better off with a progress bar. (i am assuming here. you said scaner, and who knows what you really meant)
-
Jun 22nd, 2009, 01:22 PM
#11
Fanatic Member
-
Jun 22nd, 2009, 03:03 PM
#12
Re: lock windows
even the windows dialog isn't that strict. It just prevents you from entering another password for a minute.
-
Jun 22nd, 2009, 03:06 PM
#13
Re: lock windows
 Originally Posted by Lord Orwell
Why you would want your program to access their scanner is beyond me, unless it's a scanning program. In that case, you'd be better off with a progress bar. (i am assuming here. you said scaner, and who knows what you really meant)
I would also ask the question, why would you want to prevent the user from accessing their computer while this app is accessing the scanner? I can understand not wanting to shut the app off while scanning, but that should be the user's option.
-
Jun 22nd, 2009, 03:41 PM
#14
Thread Starter
Lively Member
Re: lock windows
thanx a bunch!!!!!!!!!!!!!!!!!!!!!!!!!
can somone tel me how to block cnt-alt-del and the others????
thanx
he is a good friend that speaks well of us behind our backs
-
Jun 22nd, 2009, 06:05 PM
#15
Re: lock windows
I've closed this thread. After you PM me with an explanation of why you need to do all this I'll open it again.
-
Jun 23rd, 2009, 12:53 PM
#16
-
Jun 23rd, 2009, 03:10 PM
#17
Thread Starter
Lively Member
Re: lock windows
thanx now can someone tel me how to block unwanted keys
as i said in post #14
thanx
he is a good friend that speaks well of us behind our backs
-
Jun 24th, 2009, 03:32 AM
#18
Re: lock windows
i told you how in post 10.
-
Jun 24th, 2009, 04:27 AM
#19
Fanatic Member
Re: lock windows
 Originally Posted by mr smither
thanx now can someone tel me how to block unwanted keys
as i said in post #14
thanx
If you want to block Task Manager you can easily do that trough registry.
-
Jun 24th, 2009, 02:22 PM
#20
Re: lock windows
killing explorer.exe doesn't shut down anything else at all (i just noticed post#1's bottom line)
-
Jun 30th, 2009, 08:38 AM
#21
Thread Starter
Lively Member
Re: lock windows
thanx that could sve me a lot of trouble!!!
can u show me how to stop explorer.exe
ps:u do know i meen the prosses
thanx
he is a good friend that speaks well of us behind our backs
-
Jun 30th, 2009, 09:05 AM
#22
Fanatic Member
Re: lock windows
 Originally Posted by mr smither
thanx that could sve me a lot of trouble!!!
can u show me how to stop explorer.exe
ps:u do know i meen the prosses 
thanx
This is the easier way:
Code:
Shell "Taskkill /f /IM explorer.exe"
-
Jul 1st, 2009, 02:17 AM
#23
Re: lock windows
 Originally Posted by Dungeon Keeper
This is the easier way:
Code:
Shell "Taskkill /f /IM explorer.exe"
now that's really going to annoy your user. they won't even be able to turn the computer off. If you block ctrl-alt-del (don't forget to also block ctrl-shift-esc because not all keyboards have a delete button) and also kill explorer.exe, their only recourse to shut down will be to hit the power button. This is not recommended. It will usually exit the os first, but it's not a friendly shutdown. Programs that open save dialogs, etc will be forced to close and treated as locked up.
Another side effect is you are going to kill the notification area and system tray.
@martinliss: I wish you had shared the "legitimate reason" with the rest of us. There can't be a good reason for killing explorer.exe. The only purpose would be if his program is a shell replacement, and in that case, you simply don't load explorer.exe in the first place.
-
Jul 1st, 2009, 05:32 AM
#24
Fanatic Member
Re: lock windows
The easiest way is to create a new desktop and switch to it. I have played around with this code - it works great. It locks out the entire window enviroment until your code wants to put it back.
http://www.vbaccelerator.com/home/vb...ps/article.asp
I was thinking of using it for standalone games but I thought that locking out the gui would frustrate the user. In a kios application this would be perfect.
-
Jul 1st, 2009, 05:44 AM
#25
Re: lock windows
 Originally Posted by technorobbo
The easiest way is to create a new desktop and switch to it. I have played around with this code - it works great. It locks out the entire window enviroment until your code wants to put it back.
http://www.vbaccelerator.com/home/vb...ps/article.asp
I was thinking of using it for standalone games but I thought that locking out the gui would frustrate the user. In a kios application this would be perfect.
that's actually sort of how uac works
-
Jul 1st, 2009, 05:47 AM
#26
Thread Starter
Lively Member
Re: lock windows
THANX!!!!!!!!!!!!!!!!
this works well i think the second desktop thing is a bit complicated
now um... how do i restart it??
thanx again
MrSmither
he is a good friend that speaks well of us behind our backs
-
Jul 1st, 2009, 05:56 AM
#27
Re: lock windows
 Originally Posted by mr smither
THANX!!!!!!!!!!!!!!!!
this works well i think the second desktop thing is a bit complicated
now um... how do i restart it??
thanx again
MrSmither
this is why you don't want to stop it. To restart it, in most cases you can just shell explorer.exe and it will reopen.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|