Solved

How to press a key self ?

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Graphics32 under Delphi 10.1 Berlin 2 60
RESTRequest Parameter 4 30
Delphi: making a BW image transparent 10 35
Firemonkey allowing RTL on android 6 28
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…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

813 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

11 Experts available now in Live!

Get 1:1 Help Now