0

I have configured my application under:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\Userinit

This works perfect when I log-off and log-in, but does not lock the machine and log-in, how can I make my EXE to start during lock/switch user?

Am_I_Helpful
  • 18,735
  • 7
  • 49
  • 73
syv
  • 3,528
  • 7
  • 35
  • 50
  • http://stackoverflow.com/questions/10592431/how-to-detect-when-the-user-switches-to-the-log-on-screen – CodeCaster Feb 26 '16 at 15:41
  • Locking and switching users are completely different operations. If the executable runs at log-in, then there is no point in running it *again* when the computer is locked. – Cody Gray - on strike Feb 26 '16 at 16:17
  • Any possibility to invoke an EXE when user lock the system? I want to perform certain activities while user locks the system? – syv Feb 26 '16 at 17:19

1 Answers1

2

If the application is always running during a session switch you could listen to the SessionSwitchEvent... (I am assuming you already started the application at the first session start so it's still running while locked)

Here is some MSDN informations: https://msdn.microsoft.com/en-us/library/microsoft.win32.sessionswitcheventhandler.aspx

Abyte0
  • 852
  • 8
  • 9