?
Solved

Disable system keys

Posted on 2003-02-24
9
Medium Priority
?
193 Views
Last Modified: 2010-04-04
Hi
Can anybody show me an example of how to disable alt+tab, alt+shift+tab, alt+esc, ctrl+esc, windows keys.
NOT ctrl+alt+del it is ok

Under NT, 2000 and XP ?
And I just don't want to edit the policies. If you press thoose keys while my application has focus nothing should happend
0
Comment
Question by:bnz
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
9 Comments
 

Expert Comment

by:adrenalindx
ID: 8007661
i am having the same difficulties u r having, i ended up using policies, i no trhere is a way, it has somethin to do with gina.dll i never really bthered to look into it, anyone else ?
0
 
LVL 1

Expert Comment

by:keashF
ID: 8009104
i found this link, but it's for Win95.

http://www.delphicorner.f9.co.uk/articles/wapi12.htm

had a look at the API, there it says:

SystemParametersInfo

"SPI_SETFASTTASKSWITCH     This flag is obsolete. Previous versions of Windows use this flag to enable or disable ALT+TAB fast task switching. Beginning with Windows 95 and Windows NT version 4.0, fast task switching is always enabled."

which isn't good news, i guess

cu
keashF
0
 
LVL 2

Accepted Solution

by:
123456 earned 600 total points
ID: 8010902
Hi,
I read a question that same as you requested  ,
http://www.experts-exchange.com/Programming/Programming_Languages/Delphi/Q_20393527.html
read it may  be useful.

Best Regards
Hamid reza
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 6

Assisted Solution

by:DaFox
DaFox earned 600 total points
ID: 8012146
Hi.

It's not that easy to disable these keys on NT platform.
These are your possibilities:
- http://msdn.microsoft.com/msdnmag/issues/02/09/CQA/default.aspx
- http://msdn.microsoft.com/code/default.asp?url=/msdn-files/026/001/226/Source%20Files/DisableLowLevelKeys_cpp.asp

Best wishes,
Markus
0
 
LVL 4

Expert Comment

by:cjm30305
ID: 8018801
Set your form KeyPreview = True.

OnKeyUp event on your form do the following....

//alt+tab
if ((Key = VK_TAB)and(ssAlt in Shift))
 then
  begin
   Exit;
  end;

//alt+shift+tab
if ((Key = VK_TAB)and(ssShift in Shift)and(ssAlt in Shift))
 then
  begin
   Exit;
  end;
//alt+esc
if ((Key = VK_ESCAPE)and(ssAlt in Shift))
 then
  begin
   Exit;
  end;
//ctrl+esc
if ((Key = VK_ESCAPE)and(ssCtrl in Shift))
 then
  begin
   Exit;
  end;
//windows keys
if ((Key = VK_LWIN)or(Key = VK_RWIN))
 then
  begin
   Exit;
  end;

This will cause the procedure to exit, if any of the Windows keys, or any of the above combinations are pressed.

Hope that this helps.  It is the easiest way that I have found to do it.  
0
 
LVL 4

Expert Comment

by:cjm30305
ID: 8018962
Sorry forgot about something, and did not think it through.  Please disregard this answer as it does not work....
0
 

Expert Comment

by:CleanupPing
ID: 9317102
bnz:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
 
LVL 10

Expert Comment

by:kacor
ID: 9956186
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area for this question:
       to split points between 123456 and DaFox
Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Some days and here is the Christmas Time. I wish good luck and good health for you all and for your loved ones

kacor
EE Cleanup Volunteer
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question