0

I want to make a program that runs before the user even logs on and the gui is shown in the login screen like this:

silentcallz
  • 101
  • 4
  • 14
  • I don't believe you can have a GUI coming up on top of the windows login screen. And neither can you have a GUI program running if no user has logged in to windows OS – Vikhram Apr 29 '16 at 22:25
  • Actually [**this guy**](http://stackoverflow.com/a/3143055/3740093) found a way to run a C# GUI application on the Winlogon Desktop. However it was not an interactive GUI so I don't know if that's possible. Guess the CLR isn't totally blocked after all @adjan. :) - Although this apparently was for Windows XP, so not sure if it works but I'll give it a try. – Visual Vincent Apr 30 '16 at 08:28

2 Answers2

1

The logon screen is infact a so called "Secure Desktop". This means that it runs in a different desktop which does not interact with the normal user desktop (where GUI applications are run).

The only way to start a process in another desktop is to P/Invoke the CreateProcess() WinAPI function, specifying the window station and desktop in the STARTUPINFO structure's lpDesktop field.

However according to the MSDN article about Desktops "The Winlogon desktop's security descriptor allows access to a very restricted set of accounts, including the LocalSystem account. Applications generally do not carry any of these accounts' SIDs in their tokens and therefore cannot access the Winlogon desktop or switch to a different desktop while the Winlogon desktop is active.". This meaning you will most likely not be able to run a GUI application on the Winlogon desktop.

Though I suggest you read some about Window Stations and Desktops to get a better understanding of how it works.

Visual Vincent
  • 18,045
  • 5
  • 28
  • 75
0

It is possible to start a windows application before the logon screen. There are a few ways to do this but the most practical solution in many cases would be with a service.

Modifying the logon screen itself is another matter, however, and has been made practically impossible for security reasons. See this article for a more in depth explanation of windows logon.

The closest reasonable alternative to a gui on the logon screen would be changing the background image, although this allows for no user interaction and cannot be done in real-time.

Community
  • 1
  • 1
Betato
  • 108
  • 8