Display something on Windows 10 lock screen?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
JBensimon
Posts: 118
Joined: 19 Nov 2017, 11:19

Display something on Windows 10 lock screen?

19 Nov 2017, 20:14

Hi. When running a Windows 10 startup script (which necessarily runs as the SYSTEM account) or a scheduled task set to run (as SYSTEM) at Windows startup, is there any way to display something/anything, like a status or progress message, that would be visible to the user at the initial lock screen (the "Press Ctrl+Alt+Delete ..." prompt screen)? All my experimentation to date has failed to produce anything visible. Closest I can come, while already logged on, is to very briefly see the window of a program running as SYSTEM in Session 0 between initiating the screen lock (via Win+L) and the lock screen being fully displayed.

Alternatively, is there a way to dynamically cycle between different lock screen background images under script control?

I'll be grateful for any suggestions.

Jacques.
qwerty12
Posts: 468
Joined: 04 Mar 2016, 04:33
Contact:

Re: Display something on Windows 10 lock screen?

20 Nov 2017, 11:21

Hi,

At first I thought this would not be possible without user intervention like pressing alt+tab - I always assumed the 8 and 10 logon screens ran with a higher window band - but I edited one of my scripts with the ability to display stuff on the logon screen to show a simple MsgBox and, indeed, after rebooting I saw that message box on top of the password prompt (and also on top of the clock lock screen after enabling it again). Glad to be wrong.

Anyway. Your Task Scheduler-started script running as SYSTEM gets started in session 0 on the Default desktop. But the logon screen is displayed on a newly-created session's Winlogon desktop. If you want to show stuff on the logon screen, your script needs to be running in that session and on that session's desktop. As you're running as SYSTEM, SeTcbPrivilege grants you the ability to edit a token's session ID, and CreateProcess* lets you choose the desktop a program starts on. When you log on, the session remains the same, but the desktop is switched to Default. Locking the computer, pressing the SAS keys or displaying a UAC prompt switches you back to the Winlogon desktop. (When you log out, this session will get destroyed, along with all the programs started in it; only programs started in session 0 survive.)

My LogonMediaKeys script (https://autohotkey.com/boards/viewtopic.php?t=27709) also gets started in session 0 because of the Task Scheduler, but it's not an issue because from there I use the Terminal Services APIs to monitor for the creation of new sessions and then I have the script start another instance of itself on the logon screen's desktop of any newly-created sessions, where I can add hotkeys for the media keys.

Sadly, LogonDesktop.ahk is a mess to use. But I know it well, so if you think it can help you, feel free to PM me.

Alternatively, Windows NT has had the ability to show a custom text message on the logon screen (intended to warn off unauthorised users, I believe) for a long time - if that's all you really need, you might consider just enabling that. I can't remember how to do it, but I think it's a group policy option.
JBensimon wrote:Well, thanks again for putting me on the right track! I didn't even need to identify the Winlogon session to which the lock screen belongs (always 1 at startup anyway), I just launched the program that displays my status messages using SysInternals' PSExec with the -i (interactive) and -x (run on "Windows secure desktop") switches. The program window (in my case a SplashTextOn window) appears on the Ctrl+Alt+Del screen, remains on screen if a legal notice is displayed (Windows policy), and even remains on screen at the credentials entry screen. Exactly what I needed.
Glad you found something that works for you. I wouldn't have thought to try PSExec myself...

Best regards!
Last edited by qwerty12 on 22 Nov 2017, 15:05, edited 1 time in total.
JBensimon
Posts: 118
Joined: 19 Nov 2017, 11:19

Re: Display something on Windows 10 lock screen?

20 Nov 2017, 12:36

Great stuff, THANK YOU! I'll try to locate the session in question and target it (PSExec should be able to do it). I'll report back.

Thanks again.

Jacques.
JBensimon
Posts: 118
Joined: 19 Nov 2017, 11:19

Re: Display something on Windows 10 lock screen?

21 Nov 2017, 20:58

Well, thanks again for putting me on the right track! I didn't even need to identify the Winlogon session to which the lock screen belongs (always 1 at startup anyway), I just launched the program that displays my status messages using SysInternals' PSExec with the -i (interactive) and -x (run on "Windows secure desktop") switches. The program window (in my case a SplashTextOn window) appears on the Ctrl+Alt+Del screen, remains on screen if a legal notice is displayed (Windows policy), and even remains on screen at the credentials entry screen. Exactly what I needed.

I owe you one, qwerty12! ;-)

Jacques.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: downstairs, Google [Bot] and 189 guests