Displaying a modal form

Ask questions about creating Graphical User Interfaces (GUI) in PowerShell and using WinForms controls.
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 4 years and 10 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Displaying a modal form

Post by jvierra »

But a new desktop cannot be locked out on Windows 8 and later with that method.
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Displaying a modal form

Post by jvierra »

Here is what a secure desktop is. It is not what you think and will not do what you want. It just isolates one set of applications from all others but does not prevent switching desktops.

http://www.codingvision.net/security/c- ... -keylogger

The UAE prompt is actually raised by the system and the system can block all access to display the UAE message. The prompt is not likely running in Windows but is the System taking over the display. You would not be able to write forms code to run from the system. It is like Windows Server Core. It can only display simple dialogs and would not really have access to the users session. It just allows the application to gain full admin privileges which are blocked for admins until an application launch asks for the privileges.
User avatar
Lembasts
Posts: 405
Last visit: Wed Mar 20, 2024 1:40 pm
Has voted: 1 time
Been upvoted: 1 time

Re: Displaying a modal form

Post by Lembasts »

Thanks.
Do you have any suggestions other than a timer that I could use?
Essentially I want the form displayed as soon as they logon and not really allow them to do anything until they have completed a button on the form.
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Displaying a modal form

Post by jvierra »

The way we do this is with a custom Gina. The app that handles the login can be customized to display things like a set of legal statements and a requirement that the user read them and check an "Accept" box. This all happens before the user is actually logged in. When the user "accepts" the login proceeds. This all runs under system.

There are companies that sell custom ginas just for this purpose. In Vista and later the gina has been renamed and I don't remember the name.
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Displaying a modal form

Post by jvierra »

Here is a doc on the GINA and how to build and use it: https://docs.microsoft.com/en-us/window ... authn/gina
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Displaying a modal form

Post by jvierra »

The following is the newer preferred method of interacting before, during and after the logon:

https://docs.microsoft.com/en-us/window ... n-packages
User avatar
Lembasts
Posts: 405
Last visit: Wed Mar 20, 2024 1:40 pm
Has voted: 1 time
Been upvoted: 1 time

Re: Displaying a modal form

Post by Lembasts »

Thanks for that. DLLs are way beyond my ability Im afraid.
I think Ill stick to the timer and make it really short. If they dont press the button within 5 seconds, Ill force a logoff. We are not really expecting people to be malicious enough to try and launch task manager to kill the app within 5 seconds!
This topic is 4 years and 10 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked