Search found 59 matches

by DGDanforth
Sun Jul 16, 2017 11:13 am
Forum: Brainstorming
Topic: MS SendInput
Replies: 21
Views: 49302

Re: MS SendInput

My error!
I forgot to do a TranslateKey so that "R" gets mapped into >
It all seems to be working nicely now!
I do a Sleep(130) after a down and Sleep(80) after an up.
Works better than all my previous approaches.
Thank you!
-Doug
by DGDanforth
Sun Jul 16, 2017 10:39 am
Forum: Brainstorming
Topic: MS SendInput
Replies: 21
Views: 49302

Re: MS SendInput

Josef,
The game does not respond even when I put a 500ms delay between the down and the up.
The game has the focus when I am sending.

Code: Select all

WinApi.Sleep(sleepTime);
SendInput returns a non zero result indicating success.
-Doug
by DGDanforth
Sun Jul 16, 2017 10:00 am
Forum: Brainstorming
Topic: MS SendInput
Replies: 21
Views: 49302

Re: MS SendInput

I can use SendInput to send a keystroke to another BlackBox process. At least in this case sending a key-down is sufficient. Check if the receiving process has the focus. - Josef to another BlackBox process In my case the other process is a game. Yes, it has the focus. Let me try it again with Send...
by DGDanforth
Sat Jul 15, 2017 6:32 am
Forum: Brainstorming
Topic: MS SendInput
Replies: 21
Views: 49302

Re: MS SendInput

with SendInput there is the requirement that the other process is at the same security level, whatever that means in detail, but this is documented in msdn. Maybe that is the problem why SendInput does not work. - Josef Yes, I noticed that. I am not sure how to determine the security level (have yo...
by DGDanforth
Wed Jul 12, 2017 8:48 am
Forum: Brainstorming
Topic: MS SendInput
Replies: 21
Views: 49302

Re: MS SendInput

Maybe it is required to send both, key-down and key-up events. Are you sending both? - Josef Yes, first down and then up. I have also tried SendMessage since it claims to wait until the message is eaten. Again, I use both down and up but that does not seem work. Only PROCEDURE KeyDown (key: Key); V...
by DGDanforth
Tue Jul 11, 2017 11:00 am
Forum: Brainstorming
Topic: MS SendInput
Replies: 21
Views: 49302

Re: MS SendInput

I discovered that SendInput sends all INPUT records simultaneously (it doesn't wait after sending one INPUT). That is not what I want. So, I have broken the array of inputs into individual INPUT and send them sequentially (with a delay). That still doesn't work for sending to another process. So I a...
by DGDanforth
Sat Jul 08, 2017 4:42 am
Forum: Component Pascal
Topic: PROCEDURE calling graph
Replies: 2
Views: 11276

Re: PROCEDURE calling graph

Does anyone have a tool that produces a graph of which procedures call which within one module? In some ways this is a more difficult question than producing a multi-module IMPORT tree, as the graph can be a general (recursive) directed graph, and not simply just a tree. There is also the issue of ...
by DGDanforth
Sat Jul 08, 2017 4:37 am
Forum: Brainstorming
Topic: MS SendInput
Replies: 21
Views: 49302

Re: MS SendInput

The test program of SendInput works as advertized. However, it does not work in the context I am using. I am attempting to send keys to a different process . I can do that easily using the deprecated function WinApi.keybd_event I attach to the process and set its focus. So why do I need SendInput? I...
by DGDanforth
Wed Jul 05, 2017 12:51 pm
Forum: Brainstorming
Topic: MS SendInput
Replies: 21
Views: 49302

Re: MS SendInput

Since WinApi does not specify ccall anywhere, why should it be specified for SendInput? All Windows dll calls and callbacks use stdcall, as far as I remember. ... It may be a good idea to include SendInput in the 1.7.1 WinApi. - Josef From the sourcecode of WinApi.odc PROCEDURE [ccall] wsprintfA* [...
by DGDanforth
Wed Jul 05, 2017 12:47 pm
Forum: Brainstorming
Topic: MS SendInput
Replies: 21
Views: 49302

Re: MS SendInput

Josef,
Thank you very much!
I see there were quite a number of things I overlooked and of which
I was unaware. I now need to study and test your code.
-Doug