通过FindWindowEx查找按钮句柄

时间:2013-01-23 13:31:46

标签: c# vb.net winforms pinvoke

我试图找到安装窗口的按钮手柄,
但我无法得到按钮的手柄
(我can只获得form的句柄 但Spy++ can获取button

的句柄

这是我的代码:

    Process.Start("C:\install.exe")
    Do Until FindWindow("TWizardForm", "Setup") <> IntPtr.Zero
        Application.DoEvents()
    Loop
    Dim Formh As IntPtr = FindWindow("TWizardForm", "Setup")
    Dim nextButton As IntPtr = FindWindowEx(Formh, 0, "TNewButton", "&Next >")
    MsgBox(nextButton.tostring) ' = 0 :/

我如何获得按钮句柄(c#或vb.net)?

0 个答案:

没有答案