I have tried below code to read the caption of the active window, But I am getting all the windows in the taskbar.I want only active window to be returned.Is there any property that QTP recognizes for active window...or any vbscript function that can do it for us?
Below is the code ...
Set Obj = CreateObject("Shell.Application")
Set winObj = Obj.windows
For i= 0 to winObj.Count-1
Set eachObj = winObj.Item(i)
Set eachObj = Nothing
Set winObj = Nothing
Set Obj = Nothing
rc = Window("hwnd:="& wndHandle).GetROProperty("text")
' You can obtain text or other properties in the object spy
' You can obtain the other properties and then use them to identify the object using descriptive programming