F
F
Foraho2020-11-21 11:18:53
C++ / C#
Foraho, 2020-11-21 11:18:53

How to make a simulated keypress with C#?

Please tell me how to implement imitation of keystrokes using C #, as if the user himself pressed this key

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vladimir Korotenko, 2020-11-21
@firedragon

Look towards winapi sendMessage and others. There is a limitation though, you can only send Messages to a window in your station .

B
BasiC2k, 2020-11-21
@BasiC2k

Use WinAPI
Public Sub keybd_event(bVk As Keys, bScan As Byte, dwFlags As UInt32, dwExtraInfo As IntPtr)
End Sub
(This is a VB.NET declaration, look for examples)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question