在 C# 中将密钥发送到特定句柄?
我一直在搜索,到目前为止我只找到了 SendKeys
,它仅适用于活动窗口。但是,我不想强制窗口变为活动状态。有谁知道如何将击键发送到特定的窗口句柄?实际上,我的目标是子窗口,而 SendKeys 只执行父窗口,这就是我需要此特定功能的原因。
提前致谢!
I've been searching, and so far I've only found SendKeys
, which works only for the active window. However, I don't want to force the window to become active. Does anyone know how I can send keystrokes to a specific window handle? I'm aiming, actually, at a child window and SendKeys just does the parent window, which is why I need this specific functionality.
Thanks in advance!
您是否尝试过 SendMessage 与 WM_CHAR 还是 WM_KEYDOWN/WM_KEYUP?
Have you tried SendMessage with WM_CHAR or WM_KEYDOWN/WM_KEYUP?