Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hello all,

 

I am trying to create a logon form. The goal would be that ALL keyboard (including Ctrl-Alt-Del, windows key, etc) and lock the mouse into the form. The user would only be able to type in his bar code and last name from there the form would authenticate with the server.

 

Currently we do all kinds of crazy stuff to lock down our desktops (this is for a educational library) and I was thinking that if we could capture all of the user inputs (keyboard and mouse) then we would not have to lock down the desktops - just run the vb logon app.

 

Any help is appreciatted. We are developing solely for XP. I have been reading about keyboard hooks and GINA.DLL but we use novell and it installs it own GINA.DLL as per the winlogon stuff.

 

Thank you!

  • *Gurus*
Posted

I think you'll be out of luck on this one. You won't find a way to stop ctrl-alt-del doing what they're supposed to in any recent incarnation of windows, and probably not the other things you need either.

 

Why not leave Windows to have its own login dialog?

MVP, Visual Developer - .NET

 

Now you see why evil will always triumph - because good is dumb.

 

My free .NET Windows Forms Controls and Articles

Posted (edited)

Hello all,

 

First thanx for the help! Now to business....

 

We need to authenticate our patrons/students before they can use the system. The id for novell and windows are for the system not the user. Ie the system logs into the network and windows as Computer456 .

 

We want to have a "logon" screen where the user enters her personal bar code and last name and then can get access to the system. Hence why I want to lock out the mouse and keyboard to only one form and release the mouse and keyboard focus upon successful patron logon. We need to lock the mouse and keyboard so users cannot start IE, Word etc before logging in.

 

FM

Edited by fmaglia
Posted

Ever thought of using one of the event handlers like Deactivate so that when the user tries to access another form you can put focus right back on the logon form again and put it back on top.

 

About closing the program using Ctrl Alt Delete you could have another program that runs in the background that will shut windows down if the USER kills the logon program.

 

Just an idea. . .

C#
Posted

The issue with that is sometimes getting the top most window can get tricky and stuff. Also if someone were to put in say a USB stick the focus should still be on the logon screen. Sounds like a need a mix of both the focus of the keyboard and mouse and making sure the window is top most.

 

We are pretty well replacing the windows "welcome screen" with our own custom made version.

 

FM

Posted

In the Deactivate event you will be able to put the focus right back on the form every time something else take the focus away from it.

 

And setting that form as topmost can continually set (if need be) using a timer.

C#
Posted

It is an EventHandler.

//Hook up the event in the contructor:
this.Deactivate += new System.EventHandler(this.Form1_Deactivate);

//Here is you method that SHOULD be called evrery time the Form is deactivated
private void Form1_Deactivate(object sender, System.EventArgs e)
{
this.Focus();  this.TopMost=true;  this.BringToFront();
}

I think this.BringToFront(); is what you want but you can try both. You only need one of the two.

C#
Posted

You can also restrict the form to the desktop area so that the user cannot move it to see anything on the desktop. I have never done that before but I know it can be done fairly easily.

 

Or to make things really easy just set the forms Border style to FormBorderStyle.None to prevent the user from moving it and minimising it. That is probably your best option.

C#

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...