C# 获取子窗口句柄

发布于 2024-08-05 13:22:48 字数 173 浏览 4 评论 0原文

我正在用 C# 启动一个进程,然后使用 SendMessage 将 Windows 消息发送到该进程。通常我将消息发送到 Process.MainWindowHandle,但在某些情况下,我可能需要找到子窗口句柄并向那里发送消息。我将如何在 C# 中做到这一点以及查找子窗口的选项是什么(即是否需要知道窗口的名称或是否有其他选项)?

I'm starting a process in C# and then sending Windows messages to that process with SendMessage. Usually I send the messages to Process.MainWindowHandle, but in some instances I might need to find a child window handle and send messages there instead. How would I do that in C# and what are the options for finding child windows (i.e. do a need to know the name of the window or are there other options)?

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

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

发布评论

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

评论(1

故人的歌 2024-08-12 13:22:48

看一下 EnumChildWindows (pinvoke.net)

Take a look at EnumChildWindows (pinvoke.net)

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