Method to check contents of a window

Hi All,

I am using Win32OLE to use sendkeys method in ruby to automate a desktop
application. I want to use condition to check the contents of a page.
Can anyone please help mew to find a method in ruby to get the contents
of the particular window?

Is there any method to check out if the key has pressed or not?

Thanks

Arvind