Re: Disabling Access to Windows

[ DelphiLand Discussion Forum ]

Posted by Carlos Pimentel on April 30, 2003 at 15:23:20:

In Reply to: Re: Disabling Access to Windows posted by webmaster Guido on April 27, 2003 at 17:18:16:

: : I need lock access to windows disabling (ctrl-alt-dell), (alt-tab), (ctrl-esc) e (windows key).

: : I tried to use SystemParametersInfo(97, Word(True), @OldValue, 0) but doesn't works on Delphi6 and WindowsXP. Could you help me?

: -------

: To disable the keyboard keys that are called "system keys" (CTRL-ALT-ESC, CTRL-ESC, ALT-TAB, Windows key...), the code below works well under Win98 and Delphi 6, but I didn't test it under Windows XP. Maybe something changed under XP?

: To test it: start a new project, add two buttons to the main form and write these event handlers:

: procedure TForm1.btnLockClick(Sender: TObject);
: var
: i: integer;
: begin
: // Lock the system keys: CTRL-ALT-ESC, CTRL-ESC, ALT-TAB, Windows key...
: SystemParametersInfo(SPI_SCREENSAVERRUNNING, 1, @i, 0);
: end;

: procedure TForm1.btnUnlockClick(Sender: TObject);
: var
: i: integer;
: begin
: // Unlock the system keys, after they were locked
: SystemParametersInfo(SPI_SCREENSAVERRUNNING, 0, @i, 0);
: end;

: Note: when the Windows-key is locked, you can not open Windows' Start menu from the keyboard anymore, but it's still possible to open the Start menu by clicking the Windows' Start button in the Taskbar. So the user still can start other programs from the Start Menu, or stop Windows. If you want to prevent this, you also have to hide the Start button from Windows's Taskbar, or hide the Taskbar completely. That's possible with Delphi.

Thank you very much my friend, but doesn't work. I tried with information above and nothing. I have read about SystemParametersInfo and this procedure work just with early versions of Windows (95,98). I need develop a solution for WindowsXP Home Edition.

Thanks in Advance for any information.


Related Articles and Replies:


[ DelphiLand Discussion Forum ]