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.
User avatar
jvierra
Posts: 13733
Joined: Tue May 22, 2007 9:57 am
Contact:

Re: Displaying a modal form

Post by jvierra » Tue May 21, 2019 3:00 pm

But a new desktop cannot be locked out on Windows 8 and later with that method.

User avatar
jvierra
Posts: 13733
Joined: Tue May 22, 2007 9:57 am
Contact:

Re: Displaying a modal form

Post by jvierra » Tue May 21, 2019 3:13 pm

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: 204
Joined: Thu Mar 15, 2012 9:47 am

Re: Displaying a modal form

Post by Lembasts » Tue May 21, 2019 3:26 pm

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.

User avatar
jvierra
Posts: 13733
Joined: Tue May 22, 2007 9:57 am
Contact:

Re: Displaying a modal form

Post by jvierra » Tue May 21, 2019 3:32 pm

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.

User avatar
jvierra
Posts: 13733
Joined: Tue May 22, 2007 9:57 am
Contact:

Re: Displaying a modal form

Post by jvierra » Tue May 21, 2019 3:34 pm

Here is a doc on the GINA and how to build and use it: https://docs.microsoft.com/en-us/window ... authn/gina

User avatar
jvierra
Posts: 13733
Joined: Tue May 22, 2007 9:57 am
Contact:

Re: Displaying a modal form

Post by jvierra » Tue May 21, 2019 3:36 pm

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: 204
Joined: Thu Mar 15, 2012 9:47 am

Re: Displaying a modal form

Post by Lembasts » Tue May 21, 2019 3:57 pm

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!

Locked