Setting focus to a specific field in an external program

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sourceinfo
    New Member
    • Oct 2012
    • 1

    Setting focus to a specific field in an external program

    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:

    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!
    Last edited by Rabbit; Oct 12 '12, 01:33 AM. Reason: Please use code tags when posting code.
Working...