.NET
Microsoft Technologies based on the .NET software framework.
3,647 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
i am trying to control an application from c# application . i used spy++ to navigate the button .but it doesnot work for all buttons. how to solve it?
private void button12_Click(object sender, EventArgs e)
{
IntPtr maindHwnd = FindWindow(null, "Inspector");
if (maindHwnd != IntPtr.Zero)
{
//IntPtr panel = FindWindowEx(maindHwnd, IntPtr.Zero, "TPanel", null);
IntPtr childHwnd = FindWindowEx(maindHwnd, IntPtr.Zero, " TPanel", "Connect");
if (childHwnd != IntPtr.Zero)
{
SendMessage(childHwnd, BM_CLICK, IntPtr.Zero, IntPtr.Zero); // Send a message from the button
}
else
{
textBox3.BackColor = Color.Yellow;
textBox3.Text = "エラー";
}
}
else
{
textBox3.BackColor = Color.Yellow;
textBox3.Text = "エラーメッセージボックスありません";
}
}
Spy++ (both 32-bit and 64-bit versions) will only show controls that are actual Win32 windows (i.e., have an HWND ). Some controls that appear on the screen may be windowless and so they are not displayed by Spy++. You can frequently see such controls by using the UIAutomation tool inspect.