Solved

How to press a key self ?

Posted on 2003-10-24
4
163 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
  • 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
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…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

747 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now