0

I'm looking for a line of code in Delphi which can disable sending keys to an application. For example I have a game.exe, I want to disable sending keys to it, so you can not play it.

How to do that? Please Guide me step by step :)

4
  • could expand on what you mean by disable? Commented Aug 4, 2011 at 12:18
  • Hi,David. I mean disable sending keys. Commented Aug 4, 2011 at 12:22
  • See this question: stackoverflow.com/questions/507791/delphi-keyboard-hook Commented Aug 4, 2011 at 12:26
  • I still don't understand. At the moment, in order to answer this, we have to guess what you mean. Please spend more time editing the question to explain exactly what you want, preferably with some examples to make it 100% clear. Commented Aug 4, 2011 at 12:42

1 Answer 1

2

Hiding and blocking input should be separate questions. Your question is so vague that I'm tempted to vote to close it, but here are some general ideas instead;

  1. If you want to block all input from getting to an application,you can simply grab the focus away from that particular application, or keep your window on top and make it full screen. This is often called "Kiosk mode".

  2. You could also forcibly hide all the application's windows.

  3. You could intercept the window messages that are bound for that application and handle them yourself. See the link from Johan on Keyboard hooking.

Sign up to request clarification or add additional context in comments.

1 Comment

Majid: No real question fixes in 6 hours now, so I voted to close.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.