?
Solved

How to press a key self ?

Posted on 2003-10-24
4
Medium Priority
?
170 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 600 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
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…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses
Course of the Month7 days, 23 hours left to enroll

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