I am developing a custom credential provider for Windows 7. My goal is to automatically log-in the user when a certain hardware event occurs. I have read all the MSDN articles related to this, and implemented a simple credential provider that interfaces with the external device to get user name and password and passes it to the WinLogon.
But, I still am stuck with the last piece of the puzzle. Currently the user still has to press the logon button to log himself in. What is the best way to do that automatically?
Currently I'm working on the same and I think that
a) in function Provider::GetCredentialCount, you set a pdwDefault and set pbAutoLogonWithDefault to true
or
b) in Credential::SetSelected you set pbAutoLogon to true.
With a) the user has no choice and with b) he has to choose the account first.
After you fill credentials data, call ICredentialProviderEvents::CredentialsChanged
来源:https://stackoverflow.com/questions/8619323/windows7-credential-provider-to-automatically-logon-user-on-the-hardware-event