get the control in window

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • revacdm20635
    New Member
    • Feb 2008
    • 3

    get the control in window

    hi,

    I have to access the controls inside a window.

    I found that window using FindWindow.

    In my window there is two button.

    How can i get the control of that button, So that i have to click that button?

    My code is
    ' declaration
    Private Declare Function FindWindow Lib "user32" Alias "FindWindow A" (ByVal lpClassName As String, ByVal lpWindowName As String) As System.IntPtr

    ' code

    Dim nWnd As IntPtr
    Dim ceroIntPtr As New IntPtr(0)
    Dim Wnd_name As String

    Wnd_name = "Microsoft Internet Explorer"
    nWnd = FindWindow(Noth ing, Wnd_name)
    MsgBox(nWnd.ToS tring())
    'show the info
    If nWnd.Equals(cer oIntPtr) Then
    MsgBox("App Not Running")
    Else
    MsgBox("App Running")
    Application.DoE vents()
    SendKeys.Send(" {ENTER}")
    End If

    here i get the error in SendKeys.Send(" {Enter"}").

    How can i access the button inside this window?

    Plz help me with some code

    Thanks in advance and urgent plz...
Working...