在 vb.net 中的窗口仍处于最小化状态时将击键发送到窗口

发布于 2024-09-07 02:30:39 字数 66 浏览 1 评论 0原文

我以前懂vb6,需要快速应用。我希望有人能帮助我如何将密钥发送到 vb.net 中的最小化窗口,

谢谢

I used to know vb6 and I need to make a quick application. I hope someone can help me with how to send keys to a minimized window in vb.net

thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

电影里的梦 2024-09-14 02:30:39

通常你可以使用 SendMessage API 函数发送密钥,但我不确定窗口最小化是否会受到任何影响,我不这么认为,但我没有尝试过.
要使用 VB.Net 中的 Windows API 函数,您需要使用 PInvoke 来调用它,您可以在此 页面

SendMessage 的 MSDN 页面也可能是对于有关其工作原理的信息很有用。

顺便说一句,您可能想使用 WM_CHAR 消息,即 0x0102

Normally you can send keys with the SendMessage API function, but I'm not sure if it would be affected in any way by the window being minimized, I don't think so but I haven't tried.
To use a Windows API function from VB.Net you need to use PInvoke to call it, you can find information about how to do that on this page.

The MSDN page for SendMessage might also be useful for information about how it works.

Btw, you probably want to use the WM_CHAR message which is 0x0102.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文