嗨,我正在尝试处理外部程序中的控件。我可以获取主窗体句柄,然后是面板句柄,但无法确定我正在获取哪个面板,因为有 4 个面板显示使用 spy++
我知道我是否可以通过使用实例来选择面板,这将允许我选择我想要的面板。我想选择TPanel3。
Dim destination As IntPtr = FindWindow("TDeviceMainForm", "Gem")
If destination Then MessageBox.Show("destination")
Dim destControlpnl As IntPtr = FindWindowEx(destination, Nothing, "TPanel", Nothing)
destControlpnl = FindWindowEx(destination, Nothing, "TPanel", Nothing)
If destControlpnl Then MessageBox.Show("destControlpnl")
Dim destControl As IntPtr = FindWindowEx(destControlpnl, Nothing, "TPanel", Nothing)
If destControl Then MessageBox.Show("destControl")