Pass value to the Login Window/Screen
hi guys! help please...I want to develop a window application that could login a specific user if he/she opt to and provided his/her windows login username or password. How can I pass a value (username & password) to the Windows Login window or screen and login the specific user if he/she provide a valid username and password? btw, im not into something bad. Thanks in advance guys!
Re: Pass value to the Login Window/Screen
You mean to log a specific user into Windows itself?
Re: Pass value to the Login Window/Screen
Re: Pass value to the Login Window/Screen
Well, you wouldn't because you can't run a .NET application while there's no-one logged in. There's certainly no easy way that I'm aware of anyway. Windows already has auto-login functionality built in anyway. The information is stored in the registry. I can't remember where exactly, but you can set it via TweakUI. If you were to set a peculiar user name then it wouldn't take much to find it by searching the resistry.
Re: Pass value to the Login Window/Screen
Oh to bad for me...But i have another question. Since, i cant run a .net application while there's no-one logged in it means that i cant run my .net windows application as windows service? Because, correct me if im wrong, application that run as windows services is executed/run even if there is no-one logged in user..
Re: Pass value to the Login Window/Screen
Yes, but a service doesn't interact with the desktop. I'm not even sure how you'd access the Windows login dialogue anyway. You couldn't use Spy++ or the like to get any information about it so how could you target it, even if it was possible?
Re: Pass value to the Login Window/Screen
Yes, using a service will get you the ability to run code before the logon dialog. But however to logon you could use LogonUser or possibly CreateProcessWithLogon APIs.
Re: Pass value to the Login Window/Screen
OK...thanks for that..but, I've already seen an application that could login a specific user just placing his/her finger on the finger print reader attached to the pc....I hope there will be solution to my problem....
Re: Pass value to the Login Window/Screen
Probably the LogonUser API. Have you tried it yet?
Re: Pass value to the Login Window/Screen
Not yet...But, its a good suggestion..I'll give it a try..Thanks!
Re: Pass value to the Login Window/Screen
Re: Pass value to the Login Window/Screen
Dont use the registry settings as noted but they suggest TweakUI which still probably uses APIs to logon.
Re: Pass value to the Login Window/Screen
Thanks for that guys...But, the solution that uses registry is not the way to go. Maybe i'll just add some info in my question. Actually, i have a card reader and some Smart Cards and im planning to store the username and password of the users in the smart cards and then when ever a user insert his/her smart cards to the smart cards reader, attached to the computer, and verify that the username and password in his/her smart card is valid that username together with the password will be logged in...hope you get my point..So, registry is not really the solution. Currently, im looking into the LogonUser Api suggested by RobDog888(Sorry)...Hope this is a good start..
Re: Pass value to the Login Window/Screen
Quote:
Originally Posted by RobDog888
Probably the LogonUser API. Have you tried it yet?
Can you rate me for that? ;) :)
Re: Pass value to the Login Window/Screen
:D :bigyello: Sorry for that RobDog...Thanks John..
Re: Pass value to the Login Window/Screen
You win some, you lose some. :D
Ps, thanks daimous. :)
I'm too lazy to test it out but I'm interested to know if running it from the service worked out.
Re: Pass value to the Login Window/Screen
Unfortunately, LogonUser is not the solution becuase, as far as my understanding about the article of LogonUser from MSDN is concerned, LogonUser does not literally login a user to Windows it only gives you a impersonation token that can be use to impersonate a user...But any way, thanks for that suggestion...But just in case you found some info or solution please..do inform me...Any other input please...
Re: Pass value to the Login Window/Screen
Quote:
Originally Posted by jmcilhinney
I'm not even sure how you'd access the Windows login dialogue anyway
I've found posible solution for that HERE but im still working on it.
Re: Pass value to the Login Window/Screen
Ah, so sending keystrokes to the logon dialog works from a service. Thanks for the update.