I need to know how to get notified when login is failed during the windows os is in either log-off state or locked state in MFC/vc++? Is there any API or messages available?
Asked
Active
Viewed 78 times
0
-
You could poll the log... – Scott Solmer Jul 10 '14 at 12:04
-
@Okuma.Scott Can you please explain more? – HariDev Jul 10 '14 at 12:09
-
You know, use a polling technique to read the Windows Event Log. – Scott Solmer Jul 10 '14 at 12:13
-
1@Okuma.Scott: Do not poll when you can subscribe to events instead. [Subscribing to Events](http://msdn.microsoft.com/en-us/library/windows/desktop/aa385771.aspx) has all the information. – IInspectable Jul 10 '14 at 15:50
-
@IInspectable Good point. He'll have to [Enable Raising Events](http://msdn.microsoft.com/en-us/library/system.diagnostics.eventlog.enableraisingevents%28v=vs.110%29.aspx) in that case. – Scott Solmer Jul 10 '14 at 15:56
-
You will inevitably run into the issue that the Windows Event Log Event Source names are abbreviated. [See how this guy solved that problem while trying to log invalid passwords](http://stackoverflow.com/a/14600302/2596334). It should be the very thing you're looking for. – Scott Solmer Jul 10 '14 at 16:03