本文介绍了在C#中获取子窗口句柄的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在用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)?

推荐答案

看看 EnumChildWindows (pinvoke.net)

Take a look at EnumChildWindows (pinvoke.net)

这篇关于在C#中获取子窗口句柄的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-03 14:53