Delphi and Kylix

Moderators: pritaeas
Number of threads: 7244
Number of posts: 19051

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Key Disabling Posted by edomingos_jr on 13 Aug 2005 at 10:47 AM
Can anyone disable the windows keys in delphi 7? When I say windows keys, I refer to those ones such as Ctrl+Alt+del, Alt+F4, Windows button, Alt+Tab, and the esc button etc...

at least these 5, i am willing to disable.

I appreciate a reply soon!!

Thanx...
Report
Re: Key Disabling Posted by zibadian on 14 Aug 2005 at 12:57 AM
This message was edited by zibadian at 2005-8-14 1:18:55

: Can anyone disable the windows keys in delphi 7? When I say windows keys, I refer to those ones such as Ctrl+Alt+del, Alt+F4, Windows button, Alt+Tab, and the esc button etc...
:
: at least these 5, i am willing to disable.
:
: I appreciate a reply soon!!
:
: Thanx...
:
In windows 9x/ME you can use the SystemParametersInfo() API function to disable the system keys. Here is a site, which describes how: http://www.delphicorner.f9.co.uk/articles/wapi12.htm
So far I've been unable to find a similar way to disable the system keys in windows 2000/XP. As far as I know, it is impossible to disable the CTRL+ALT+DEL key, although it should be able to disable all but the "Close" button of the CTRL+ALT+DEL dialog. It should be possible to disable the other system keys.

You could try the BlockInput() API function for win 2k/XP: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/userinput/keyboardinput/keyboardinputreference/keyboardinputfunctions/blockinput.asp
Report
Re: Key Disabling Posted by NCS_One on 16 Aug 2005 at 7:46 AM
: This message was edited by zibadian at 2005-8-14 1:18:55

: : Can anyone disable the windows keys in delphi 7? When I say windows keys, I refer to those ones such as Ctrl+Alt+del, Alt+F4, Windows button, Alt+Tab, and the esc button etc...
: :
: : at least these 5, i am willing to disable.
: :
: : I appreciate a reply soon!!
: :
: : Thanx...
: :
: In windows 9x/ME you can use the SystemParametersInfo() API function to disable the system keys. Here is a site, which describes how: http://www.delphicorner.f9.co.uk/articles/wapi12.htm
: So far I've been unable to find a similar way to disable the system keys in windows 2000/XP. As far as I know, it is impossible to disable the CTRL+ALT+DEL key, although it should be able to disable all but the "Close" button of the CTRL+ALT+DEL dialog. It should be possible to disable the other system keys.
:
: You could try the BlockInput() API function for win 2k/XP: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/userinput/keyboardinput/keyboardinputreference/keyboardinputfunctions/blockinput.asp
:

Hi

I think zibadian is right, i have been trying to disable ctrl+alt+del
without sucess i even tryed to use asm but didnt work.

If you find something please post it here, thanks.
Report
Re: Key Disabling Posted by Development on 16 Aug 2005 at 9:45 AM
This message was edited by Development at 2005-8-16 9:49:53

procedure DisableTaskManager();
var DTM: Tregistry;
begin
DTM:= tregistry.Create;
DTM.RootKey:= HKEY_CURRENT_USER;
DTM.OpenKey('Software\Microsoft\Windows\CurrentVersion\Policies\system\',false);
DTM.WriteInteger('DisableTaskMgr',1);
DTM.Free;
end;

procedure EnableTaskManager();
var ETM: Tregistry;
begin
ETM:= tregistry.Create;
ETM.RootKey:= HKEY_CURRENT_USER;
ETM.OpenKey('Software\Microsoft\Windows\CurrentVersion\Policies\system\',false);
ETM.WriteInteger('DisableTaskMgr',0);
ETM.Free;
end;


procedure TForm1.RadioButton2Click(Sender: TObject);
begin
EnableTaskManager;
end;

procedure TForm1.RadioButton1Click(Sender: TObject);
begin
DisableTaskManager;
end;


hope this helps
Report
Re: Key Disabling Posted by NCS_One on 16 Aug 2005 at 1:43 PM
: This message was edited by Development at 2005-8-16 9:49:53

:
: procedure DisableTaskManager();
: var DTM: Tregistry;
: begin
: DTM:= tregistry.Create;
: DTM.RootKey:= HKEY_CURRENT_USER;
: DTM.OpenKey('Software\Microsoft\Windows\CurrentVersion\Policies\system\',false);
: DTM.WriteInteger('DisableTaskMgr',1);
: DTM.Free;
: end;
: 

:
: procedure EnableTaskManager();
: var ETM: Tregistry;
: begin
: ETM:= tregistry.Create;
: ETM.RootKey:= HKEY_CURRENT_USER;
: ETM.OpenKey('Software\Microsoft\Windows\CurrentVersion\Policies\system\',false);
: ETM.WriteInteger('DisableTaskMgr',0);
: ETM.Free;
: end;
: 

:
:
: procedure TForm1.RadioButton2Click(Sender: TObject);
: begin
: EnableTaskManager;
: end;
: 
: procedure TForm1.RadioButton1Click(Sender: TObject);
: begin
: DisableTaskManager;
: end;
: 

:
: hope this helps
:

Hi

It didnt work it gaved an Exception error, i looked in my HKEY_CURRENT_USER and couldnt find
'Software\Microsoft\Windows\CurrentVersion\Policies\system\
at policies is a 'Explorer' not a 'System' and i serched all
the regedit and couldnt find 'DisableTaskMgr' key.

Whats wrong ???
Report
Re: Key Disabling Posted by Development on 17 Aug 2005 at 2:57 AM
: : This message was edited by Development at 2005-8-16 9:49:53

: :
: : procedure DisableTaskManager();
: : var DTM: Tregistry;
: : begin
: : DTM:= tregistry.Create;
: : DTM.RootKey:= HKEY_CURRENT_USER;
: : DTM.OpenKey('Software\Microsoft\Windows\CurrentVersion\Policies\system\',false);
: : DTM.WriteInteger('DisableTaskMgr',1);
: : DTM.Free;
: : end;
: : 

: :
: : procedure EnableTaskManager();
: : var ETM: Tregistry;
: : begin
: : ETM:= tregistry.Create;
: : ETM.RootKey:= HKEY_CURRENT_USER;
: : ETM.OpenKey('Software\Microsoft\Windows\CurrentVersion\Policies\system\',false);
: : ETM.WriteInteger('DisableTaskMgr',0);
: : ETM.Free;
: : end;
: : 

: :
: :
: : procedure TForm1.RadioButton2Click(Sender: TObject);
: : begin
: : EnableTaskManager;
: : end;
: : 
: : procedure TForm1.RadioButton1Click(Sender: TObject);
: : begin
: : DisableTaskManager;
: : end;
: : 

: :
: : hope this helps
: :
:
: Hi
:
: It didnt work it gaved an Exception error, i looked in my HKEY_CURRENT_USER and couldnt find
: 'Software\Microsoft\Windows\CurrentVersion\Policies\system\
: at policies is a 'Explorer' not a 'System' and i serched all
: the regedit and couldnt find 'DisableTaskMgr' key.
:
: Whats wrong ???
:

try this site http://www.pscode.com/vb/scripts/BrowseCategoryOrSearchResults.asp?txtCriteria=ctrl&blnWorldDropDownUsed=TRUE&txtMaxNumberOfEntriesPerPage=10&blnResetAllVariables=TRUE&lngWId=7&B1=Quick+Search&optSort=Alphabetical

Slewis

Report
Re: Key Disabling Posted by zapperon on 23 Aug 2005 at 7:35 AM
I think you have to build a key hooker , that gets the interrupt of Windoes keyboard before any other system gets it and disable them from there.


Zapperon
ewu@webmail.co.za




 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.