Detect screen lock - FMX in Win32
I want my application to run some code when the screen gets locked (Win 7 and 10). My application may be in the background too when user locks screen. Anyone point me in right direction? Thank you, relayman Use WTSRegisterSessionNotification() to register an HWND to receive WTS_SESSION_(UN)LOCK notifications via the WM_WTSSESSION_CHANGE window message. You can use FMX's FormToHWND() function to obtain your Form's HWND . However, FireMonkey controls, including Forms, do not have an overridable WndProc() method to process window messages, like VCL does, so you will have to use the Win32 API's