How to select a radio button in internet explorer

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sososm
    New Member
    • Mar 2011
    • 1

    How to select a radio button in internet explorer

    Hy experts

    I need a little help here. Can anybody tell me how to select
    a radio button from another program knowing the name,id or text of the radio button.
    I want to automate internet explorer by checking the "First Name" radio button then pressing the "Send" button.

    This is the code I'm using to get the focus to internet explorer:

    Code:
    using System;
    using System.Text;
    using System.Windows.Forms;
    using System.Runtime.InteropServices;
    
    public class getWindow
    {
      [DllImport("user32.dll")]
      public static extern IntPtr FindWindow(string IpClassName, string IpWindowName);
    
      [DllImport("user32.dll")]
      public static extern int SetForegroundWindow(IntPtr hWnd);
    
      public static void Main(string[] args)
      {
        IntPtr iHandle = FindWindow(null," Details - Windows Internet Explorer");
        SetForegroundWindow(iHandle);
      }
    }
    Any help would be appreciated.
    Thank you in advance.
  • HaLo2FrEeEk
    Contributor
    • Feb 2007
    • 404

    #2
    I'm not sure exactly how to go about doing this, but a good start might be figuring out what messages IE takes and see if you can send a message to the address bar, then send some javascript to check the radio button.

    Comment

    Working...