E
E
etojemph2015-10-25 00:46:35
Delphi
etojemph, 2015-10-25 00:46:35

Delphi, how to programmatically press a key in someone else's window knowing the handle of the window?

Hello, I've been sitting for hours looking for information on how to press a key in someone else's window (for example, F1) knowing the window handle. The problem is that FindWindow cannot find the window by its title.
How to proceed, what to do?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Mark Doe, 2015-10-25
@mourr

So FindWindow will actually return the Handle, since you already know it - what's the problem?
SendMessage takes the window Handle as the first parameter, the second you pass WM_KEYDOWN, the third - VK_F1

K
kalapanga, 2015-10-25
@kalapanga

Why isn't it looking for it? We need to deal with this. Maybe you're looking for child window and need to use FindWindowEx? Or is the title of some wrong / wrong transfer?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question