locked
gui help - forms RRS feed

  • Question

  • Hi Scripting guys,

    I've created a gui for a scipt i've wrote and I need to lock down the form e.g. stop it being resized and to stay on top.

    There are two last requests for the form that i can't seem to find a fix for...

    1. stop users opening other programs before the message on the screen is actioned e.g. stop them clicking the start menu. I have made it so the form stays on top all the time already, just would like to disable all other user actions.

    2. Stop users being able to move the window out of the way. Currently they cannot resize the form nor close it without clicking accept I need it to be fixed on the screen. I have set the start location of the form to random which needs to continue - once it has openen I need it to be fixed and not move.

    As always any help would be welcome

    Joe

    Monday, June 30, 2014 3:43 PM

Answers

  • #1 - can't be done with script.

    #2 - can't be done with script.

    Both are disallowed by Windows security.  Only a low level API can own the desktop.

    You can create a new desktop and switch to it.  It the user doesn't know how to hot-key the desktop then they are stuck there until you flip back to the default desktop.


    ¯\_(ツ)_/¯

    • Marked as answer by JOEs_SG Monday, June 30, 2014 3:53 PM
    Monday, June 30, 2014 3:48 PM

All replies

  • #1 - can't be done with script.

    #2 - can't be done with script.

    Both are disallowed by Windows security.  Only a low level API can own the desktop.

    You can create a new desktop and switch to it.  It the user doesn't know how to hot-key the desktop then they are stuck there until you flip back to the default desktop.


    ¯\_(ツ)_/¯

    • Marked as answer by JOEs_SG Monday, June 30, 2014 3:53 PM
    Monday, June 30, 2014 3:48 PM
  • Jrv,

    Thanks for your quick response as ever!

    That's great, I've got another option which just covers the whole screen so the only actions they can do are - Accept , Alt+f4 , ctrl+alt+del etc fingers crossed this will be ok. 

    Until next time... :)

    Joe 

    Monday, June 30, 2014 3:52 PM
  • In addition to what jrv said, you can use the "imagine if this were possible" thought experiment to help you understand why this isn't possible.

    The arms race between programs and users


    -- Bill Stewart [Bill_Stewart]

    Monday, June 30, 2014 3:55 PM
  • In addition to what jrv said, you can use the "imagine if this were possible" thought experiment to help you understand why this isn't possible.



    -- Bill Stewart [Bill_Stewart]

    Hi Bill,

    exactly -  this script is for an fair use policy, basically we want the users to accept it before they start working. Like a website asking you to accept the terms and conditions before you buy; we just want them to accept the policy before they use our machines. :) Once they click OK it all goes away.

    Thanks for the link- it made an interesting read :)

    Joe


    Tuesday, July 1, 2014 8:07 AM
  • Hi Jrv,

    Another Q for you.

    Could you suggest a way of adding an if statement for clicking a button... I get the jist of the if statements but not sure of the commands to do what I want.. as follows.

    If ($button1 is not clicked after 20 seconds)   ## Its this line i'm having the trouble with.

    { launch window again }

    Thanks

    Joe

    Tuesday, July 1, 2014 8:43 AM
  • In addition to what jrv said, you can use the "imagine if this were possible" thought experiment to help you understand why this isn't possible.



    -- Bill Stewart [Bill_Stewart]

    Hi Bill,

    exactly -  this script is for an fair use policy, basically we want the users to accept it before they start working. Like a website asking you to accept the terms and conditions before you buy; we just want them to accept the policy before they use our machines. :) Once they click OK it all goes away.

    Thanks for the link- it made an interesting read :)

    Joe


    You will need to produce a custom GINA for that.   There are companies that make a GINA that does exactly what you ask.  Search for that.  It is the only way to do what you are asking. 

    ¯\_(ツ)_/¯

    Tuesday, July 1, 2014 11:41 AM
  • Hi Jrv,

    Another Q for you.

    Could you suggest a way of adding an if statement for clicking a button... I get the jist of the if statements but not sure of the commands to do what I want.. as follows.

    If ($button1 is not clicked after 20 seconds)   ## Its this line i'm having the trouble with.

    { launch window again }

    Thanks

    Joe

    What you are asking is not possible as asked.  What button are we talking about?

    Look into using a timer control to cause timeouts to occur.  There is no 'IF" statement for this situation.


    ¯\_(ツ)_/¯


    • Edited by jrv Tuesday, July 1, 2014 11:43 AM
    Tuesday, July 1, 2014 11:42 AM
  • After summarizing all of your questions it is clear that you are not trained (certified) in Windows administration.  Most of what you ask come from a lack of technical knowledge of Windows and of Windows administration.  Your questions come up over and over again and are all addressed in one way or another in certification training.  You might consider purchasing a used or old MCSE book set and spending time with the training.  It will fill in many of the blanks.

    As for the specific "forms" questions - the use of Forms is tricky and usually the domain of programmers. PowerShell has made this accessible to admins but the availability of training for this is very limited in the PS environment.

    Here are a good set of resources for Forms building with PowerShell: http://www.sapien.com/blog/topics/user-interface-design-for-administrators/

    See right side of page for links to other sites with Forms training.


    ¯\_(ツ)_/¯

    Tuesday, July 1, 2014 11:50 AM
  • this script is for an fair use policy, basically we want the users to accept it before they start working.

    That's the purpose of the legalnoticecaption and legalnotice settings, that can be configured by GPO.

    http://support.microsoft.com/default.aspx?scid=kb;EN-US;310430


    -- Bill Stewart [Bill_Stewart]

    Tuesday, July 1, 2014 2:13 PM