Board index » delphi » How to send windows messages to the game?

How to send windows messages to the game?

This question is related more to windows programming than to Delphi, but
some of you
might know how to solve my big problem. I'm trying to send some keystroke
(like F12)
to a game (Driver). I tried with SendMessage, PostMessage, keybd_evnt and
few other
API calls, but they seem to work only with non full screen applications and
iconized
(with titlebar) applications (like calc, notepad, ...). What I'm trying to
do is to
send wm_keyDown and wm_keyUp message to the game. The same code I write for
Calc
doesn't work for the Driver. Is there any solution for this? It's almost 3
days since
I got to this problem and I would greatly appreciate if someone can help me.
Thanks!

----------------------------------------------------------------------
Link deactivated.
Send mail to: SendToB...@iNet.Hr to activate it again.
----------------------------------------------------------------------

 

Re:How to send windows messages to the game?


I don't think you can send Windows messages to a Direct3D game, which I
presume "driver" is.

Quote
"Burs" <rbur...@net4u.hr> wrote in message

news:ahckle$j0a$1@brown.net4u.hr...
Quote
> This question is related more to windows programming than to Delphi, but
> some of you
> might know how to solve my big problem. I'm trying to send some keystroke
> (like F12)
> to a game (Driver). I tried with SendMessage, PostMessage, keybd_evnt and
> few other
> API calls, but they seem to work only with non full screen applications
and
> iconized
> (with titlebar) applications (like calc, notepad, ...). What I'm trying to
> do is to
> send wm_keyDown and wm_keyUp message to the game. The same code I write
for
> Calc
> doesn't work for the Driver. Is there any solution for this? It's almost 3
> days since
> I got to this problem and I would greatly appreciate if someone can help
me.
> Thanks!

> ----------------------------------------------------------------------
> Link deactivated.
> Send mail to: SendToB...@iNet.Hr to activate it again.
> ----------------------------------------------------------------------

Re:How to send windows messages to the game?


Games probably watch the key state instead of up and down messages.

Have you tried using the function SetKeyboardState? You might also
want to look at GetKeyboardState, GetKeyState, GetAsyncKeyState and
MapVirtualKey

Marc

Other Threads