Solved

How to press a key self ?

Posted on 2003-10-24
4
167 Views
Last Modified: 2010-04-05
Well... this is not the if KeyPress thing..... Its like When whatever = whatever Press the Key :)
I really dont know if its possible what i need is:

A Delphi Program that see what other program( a full screen one ) do - done
When whatever = whatever ( at the Delphi program ) the Delphi program will press the key "1" i.e
Of corse that the Delphi program is running behind the main program so the "1" key will affect the main program.

Well... thats it.  Damn my english sux ( i am brazilian ) Sorry guys.....
 
0
Comment
Question by:furmiga
[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
  • 2
4 Comments
 
LVL 11

Accepted Solution

by:
robert_marquardt earned 200 total points
ID: 9612803
The function you search for is named keybd_event
Look it up in the Microsoft Win32 help.
It generates key down or key up events.
0
 
LVL 7

Author Comment

by:furmiga
ID: 9612888
Well... Almost there :) The problem is : It seams that the program cant act when the mais program( the full screen one ) is running. when the whatever = whatever the programn cant recieve the key but when I Alt+tab the and alt+tab again the mais program receives the key information....

dunno if u r understanding me :)

i am using

if i1 < 110 then
begin
  keybd_event( Ord('1'), MapvirtualKey( Ord('1'), 0), 0, 0 );
end;

Maybe cuz of the FullScreen stuff the program cant run or cant really press the key. dunno.
0
 
LVL 7

Author Comment

by:furmiga
ID: 9612982
Forget about it... i made it ! Thx for the comment i ll acept.
0
 

Expert Comment

by:SoulessZero
ID: 9623166
Hi, I think you have to write a Windows Hook function and install it on system so that hook function can monitor every key pressed in any program. Read Delphi Win32 API help, look for following function and read it carefully.

1. SetWindowHookEx
2. CallNextHookEx
3. UnHookWindowsHookEx
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

756 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