chidambaram
Well-known member
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 "FindWindowA" (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(Nothing, Wnd_name)
MsgBox(nWnd.ToString())
'show the info
If nWnd.Equals(ceroIntPtr) Then
MsgBox("App Not Running")
Else
MsgBox("App Running")
Application.DoEvents()
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...
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 "FindWindowA" (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(Nothing, Wnd_name)
MsgBox(nWnd.ToString())
'show the info
If nWnd.Equals(ceroIntPtr) Then
MsgBox("App Not Running")
Else
MsgBox("App Running")
Application.DoEvents()
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...