0

I want to lock a maximized form, so that the user has no access to Windows or the taskbar, so that the PC is completely locked, and the customer can't do anything but use the application.

The form/application may only be quit, when a password is filled in.

I know that I should check for window keys or shortcuts, but I have no idea how, and I can't find anything similar.

nobody
  • 19,814
  • 17
  • 56
  • 77
GertDeWilde
  • 351
  • 1
  • 3
  • 18
  • Do you open it as a dialog? – ilans Oct 07 '14 at 12:03
  • 2
    Search about [Kiosk Mode](http://www.bing.com/search?q=windows%20kiosk%20mode&qs=n&sk=&sc=4-18&form=BDKTKB&pc=BDT5&shash=&BDParam=0000&mkt=en-US) – Steve Oct 07 '14 at 12:07
  • In addition to Kiosk Mode, you can provide either a GINA or [Credential Provider](http://msdn.microsoft.com/en-us/library/windows/desktop/bb648647%28v=vs.85%29.aspx) (depending on target Windows version - NT5 or NT6) to customize the login/unlock process. – nobody Oct 07 '14 at 17:35

2 Answers2

0

What you're really talking about is running in some kind of kiosk mode. There's quite a thorough discussion of this in another question, and the two solutions come down to:

  1. Blocking all hotkeys
  2. Replacing Explorer with your app as the shell

The first method is obviously more transient, but you'll run the risk of playing whack-a-mole with the various hotkeys (e.g. ctrl-alt-del).

Community
  • 1
  • 1
Geoff
  • 8,551
  • 1
  • 43
  • 50
-1

You can set Form.FormBorderStyle to FormBorderStyle.None and Form.WindowState to FormWindowState.Maximized to toggle fullscreen. You can handle Form.FormClosing to disable manual closing by setting FormClosingEventArgs.Cancel to True.

spongebob
  • 8,370
  • 15
  • 50
  • 83
  • That should be good to cover the whole screen but need to disable keypress, else a simple alt+tab will allow user to switch to desktop :) – Nadeem_MK Oct 07 '14 at 15:14
  • @Nadeem_MK `Ctrl + Alt + Canc` will always work. My solution will never be completely secure. – spongebob Oct 07 '14 at 16:22
  • Of course not, you can cancel it out using the keypress event! By the way, I didn't vote down your answer. – Nadeem_MK Oct 08 '14 at 06:02