How do I set focus to a specific field in an external program? Our application is middleware that sends data to a different application through a port, but we then switch the screen focus to the other app. This is successful. What is unsucessful is setting the cursor to a specific field. The following is one of our efforts:
Thanks!
Code:
if (hChldAft != IntPtr.Zero)
{
hNxtChld = WindowFuncs.FindWindowEx(hNxtChld, hChldAft, WindowFuncs.fesmChild3, "");
StringBuilder ipSB = new StringBuilder("");
//WindowFuncs.SendMessage(h, WindowFuncs.WM_NEXTDLGCTL, hNxtChld, WindowFuncs.TRUE);
WindowFuncs.PostMessage(h, WindowFuncs.WM_NEXTDLGCTL, hNxtChld, WindowFuncs.TRUE);
WindowFuncs.SetFocus(hNxtChld);
//WindowFuncs.SetFocus((IntPtr)264424);
focusPlaced = true;
}
Thanks!